Skip to content
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

obfuscate: use utf8_tohtml for hex mode encoding #2671

Merged
merged 3 commits into from Aug 16, 2019
Merged

Conversation

phy25
Copy link
Collaborator

@phy25 phy25 commented Jan 11, 2019

This fixes #2665.

In order to implement this, utf8_tohtml adds a $all param to encode everything not utf8 (default false).

Note that obfuscate's output for "regular" char (codepoint < 2bytes) has also changed (before hex, now decimal), due to the current behavior of utf8_tohtml(). In this case, the config value "hex" doesn't mean "hex" anymore, but it still obfuscates characters as numbers, as expected (see changed common_obfuscate.test.php). It might need doc update to explain hex is no longer "hex" if this gets accepted.

This is useful when every character needs to be converted to HTML entities, e.g. (email) `obfuscate()`. Respective test has also been added.
Note that its output for "regular" char (codepoint < 2bytes) has also changed (before hex, now decimal), due to the current behavior of utf8_tohtml. In this case, the config value "hex" doesn't mean "hex" anymore, but it still obfuscates characters as numbers, as expected. This might need doc update.
@splitbrain splitbrain merged commit c763c4f into master Aug 16, 2019
@splitbrain splitbrain deleted the issue2665 branch August 16, 2019 06:45
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.

Subject/body in email links rendered incorrectly if "mailguard" option is set to "hex"
2 participants