-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Debug] deprecate protected ExceptionHandler::utf8Htmlize #13899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
nicolas-grekas
commented
Mar 11, 2015
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | yes |
Tests pass? | yes |
Fixed tickets | - |
License | MIT |
Doc PR | - |
|
||
return htmlspecialchars($str, ENT_QUOTES | (PHP_VERSION_ID >= 50400 ? ENT_SUBSTITUTE : 0), 'UTF-8'); | ||
} | ||
|
||
/** | ||
* HTML-encodes a string | ||
*/ | ||
private function htmlEncode($str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
escapeHtml
might be a better name
16ea8d5
to
be77b96
Compare
be77b96
to
132b3b1
Compare
Thank you @nicolas-grekas. |
…(nicolas-grekas) This PR was merged into the 2.7 branch. Discussion ---------- [Debug] deprecate protected ExceptionHandler::utf8Htmlize | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 132b3b1 [Debug] deprecate ExceptionHandler::utf8Htmlize
restore_error_handler(); | ||
|
||
$str = iconv($charset, 'UTF-8', $str); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why removing this code ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two reasons: because of the function_exists
check, the behavior is not deterministic, and not all strings are convertible from CP1252 to UTF-8, ("\x9D"
). The code block is broken. Because of the function_exists check, this can be removed without BC pb