Skip to content

[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

Merged
merged 1 commit into from
Mar 12, 2015

Conversation

nicolas-grekas
Copy link
Member

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)
Copy link
Member

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

@nicolas-grekas
Copy link
Member Author

Body of the PR have been moved to #13901, only the deprecation remains here. Should be merged on top of #13901

@nicolas-grekas nicolas-grekas changed the title [Debug] add charset param to ExceptionHandler [Debug] deprecate protected ExceptionHandler::utf8Htmlize Mar 11, 2015
@fabpot
Copy link
Member

fabpot commented Mar 12, 2015

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 132b3b1 into symfony:2.7 Mar 12, 2015
fabpot added a commit that referenced this pull request Mar 12, 2015
…(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
@nicolas-grekas nicolas-grekas deleted the debug-charset branch March 12, 2015 14:34
restore_error_handler();

$str = iconv($charset, 'UTF-8', $str);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why removing this code ?

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants