i’m using sanitize::paranoid on a string but i need to exclude a few special characters but it doesn’t seem to work.
$content=sanitize::paranoid($content,array('à',' '));
I’ve changed the encoding of my file from ansi to utf8 but cakephp doesn’t really like it so i need to find another way.
That array should contain the list of characters to exclude from sanitization, but it keep removing the “à” and i want those character in the final string.
Sanitize:paranoidis a simplepreg_replace($allowis just additional characters, escaped):As you can see,
paranoidis quite paranoid… doesn’t accept non-ascii letters by default.The file where you had the
àwas probably saved in another encoding (working on windows?)Anyway, if you want you can write a better filter by using
/[^\p{L}]/u, which excludes letters in any lanaguage.