bug #12555 [Debug] fix ENT_SUBSTITUTE usage (nicolas-grekas)
This PR was merged into the 2.6 branch.
Discussion
----------
[Debug] fix ENT_SUBSTITUTE usage
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
58476e1
[Debug] fix ENT_SUBSTITUTE usage
This commit is contained in:
commit
7fd45f7d08
@ -384,11 +384,6 @@ EOF;
|
|||||||
*/
|
*/
|
||||||
private function formatArgs(array $args)
|
private function formatArgs(array $args)
|
||||||
{
|
{
|
||||||
if (PHP_VERSION_ID >= 50400) {
|
|
||||||
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
|
|
||||||
} else {
|
|
||||||
$flags = ENT_QUOTES;
|
|
||||||
}
|
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach ($args as $key => $item) {
|
foreach ($args as $key => $item) {
|
||||||
if ('object' === $item[0]) {
|
if ('object' === $item[0]) {
|
||||||
@ -429,7 +424,7 @@ EOF;
|
|||||||
$str = iconv($charset, 'UTF-8', $str);
|
$str = iconv($charset, 'UTF-8', $str);
|
||||||
}
|
}
|
||||||
|
|
||||||
return htmlspecialchars($str, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
return htmlspecialchars($str, ENT_QUOTES | (PHP_VERSION_ID >= 50400 ? ENT_SUBSTITUTE : 0), 'UTF-8');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user