Open reneappeldoorn opened 6 years ago
can confirm this is happening on PHP7.1, on PHP5 everything works as expected.
I can't reproduce.
ezyang@sabre:~/Dev/htmlpurifier$ php7.1 test.php
Testé &
Testéé &
Testé & text &
Testéé & text &
Testééé & text &
ezyang@sabre:~/Dev/htmlpurifier$ php test.php
Testé &
Testéé &
Testé & text &
Testéé & text &
Testééé & text &
ezyang@sabre:~/Dev/htmlpurifier$ cat test.php
<?php
include_once 'library/HTMLPurifier.auto.php';
$msg = ['Testé &', 'Testéé &', 'Testé & text &','Testéé & text &','Testééé & text &'];
foreach($msg as $val){
$purifier = new HTMLPurifier();
echo $purifier->purify($val) . "\n";
}
Judging from the code sample, you're not using straight HTML Purifier. What library are you using?
Thanks! Yes, we use the straight HTML Purifier. So I've gone one step further: I've been able to test it on PHP version 7.2.11 (output is fine!) and and PHP version 7.1.22 (output is wrong!) So it looks like it is a specific PHP 7.1.22 issue... are you able to test it on 7.1.22? Our production environment is currently on 7.1.22...
That's very interesting. I test on 7.2.23, any reason you can't upgrade? :) (This is probably a PHP bug, but we can probably figure out a way to workaround it; it's not the first time we had to do this in HTML Purifier.)
We can't upgrade to 7.2 yet, running an app that isn't yet compatible with 7.2. Would be nice to have a workaround, even though we're working on upgrading to to 7.2...
Using PHP 7 the output of
René & Danny
isRen&eacute; & Danny
instead of the expectedRené & Danny
. It's a specific character combination, you can test it using the following PHP code:This behaviour is only on PHP 7, using the exact same code on PHP 5 the output will be as expected.