Skip to content

Commit

Permalink
[Debug] deprecate ExceptionHandler::utf8Htmlize
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Mar 11, 2015
1 parent 6963887 commit 132b3b1
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/Symfony/Component/Debug/ExceptionHandler.php
Expand Up @@ -412,19 +412,12 @@ private function formatArgs(array $args)

/**
* Returns an UTF-8 and HTML encoded string
*
* @deprecated since version 2.7, to be removed in 3.0.
*/
protected static function utf8Htmlize($str)
{
if (!preg_match('//u', $str) && function_exists('iconv')) {
set_error_handler('var_dump', 0);
$charset = ini_get('default_charset');
if ('UTF-8' === $charset || $str !== @iconv($charset, $charset, $str)) {
$charset = 'CP1252';
}
restore_error_handler();

$str = iconv($charset, 'UTF-8', $str);
}
trigger_error('The '.__METHOD__.' method is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);

return htmlspecialchars($str, ENT_QUOTES | (PHP_VERSION_ID >= 50400 ? ENT_SUBSTITUTE : 0), 'UTF-8');
}
Expand Down

0 comments on commit 132b3b1

Please sign in to comment.