Hi Fabien,
Don't see substr() command in the safeDecodeLabel command.
If you need to output an UTF8 string value, here is my suggestion :
static public function safeDecodeLabel($value)
{
if(empty($value)) {
return $value;
}
$raw = urldecode($value);
$value = htmlspecialchars_decode($raw , ENT_QUOTES);
if(self::$outputHtml)
{
// Pre 5.3
if(!defined('ENT_IGNORE')) {
$style = ENT_QUOTES;
} else {
$style = ENT_QUOTES | ENT_IGNORE;
}
// See changes in 5.4: http://nikic.github.com/2012/01/28/htmlspecialchars-improvements-in-PHP-5-4.html
// Note: at some point we should change ENT_IGNORE to ENT_SUBSTITUTE
$value = htmlspecialchars($value, $style);
}
return utf8_encode($value);
}
And this work on my PHP 5.2.1 server.
Don't see substr() command in the safeDecodeLabel command.
If you need to output an UTF8 string value, here is my suggestion :
static public function safeDecodeLabel($value)
{
if(empty($value)) {
return $value;
}
$raw = urldecode($value);
$value = htmlspecialchars_decode($raw , ENT_QUOTES);
if(self::$outputHtml)
{
// Pre 5.3
if(!defined('ENT_IGNORE')) {
$style = ENT_QUOTES;
} else {
$style = ENT_QUOTES | ENT_IGNORE;
}
// See changes in 5.4: http://nikic.github.com/2012/01/28/htmlspecialchars-improvements-in-PHP-5-4.html
// Note: at some point we should change ENT_IGNORE to ENT_SUBSTITUTE
$value = htmlspecialchars($value, $style);
}
return utf8_encode($value);
}
And this work on my PHP 5.2.1 server.