Search code examples
phpmysqlckeditorhtmlpurifier

'+' character not saving through CKEditor/PHP/MySQL/HTMLPurifier


I am trying to get UTF-8 encoding working with CKEditor/PHP/MySQL/HTMLPurifier.

I have converted the character sets of the database tables/fields to utf8-unicode-ci.

I have set the following in the ckeditor config:

config.entities = true;
config.entities_latin = true;
config.entities_greek = true;
config.entitles_processNumerical = true; 

And PHP is purifying the HTML with HTMLPurifier with the default settings.

I'm not sure if I'm doing the right thing for trying to accept UTF-8, but characters such as α are working... but for some reason, any '+' in the text just simply disappears.

Any ideas?


Solution

  • I had unnecessarily urlencoded the text before the post request, while jQuery/AJAX was already encoding it. Removed the javascript encode() and the PHP urldecode() and it fixed the problem.