Problem/Motivation

The method obfuscateEmail() of class ObfuscateMailHtmlEntity iterates over the value's bytes, not its charaters.
While this might not be an issue with email addresses (since they are plain ASCII in most cases), it can be a problem when an additional link label is passed to getObfuscatedLink(). If this string contains characters that are encoded with more than one byte (e.g., German umlauts), those characters will be broken.

Proposed resolution

Use a different method for iterating over the string, e.g. as proposed here.
Use mb_ord() instead of ord() for encoding characters.

Comments

mrshowerman created an issue. See original summary.

mrshowerman’s picture

Issue summary: View changes
mrshowerman’s picture

Here's a first patch which simply disables the obfuscation of the additional link label, if it is provided.

mrshowerman’s picture

Status: Active » Needs review
mrshowerman’s picture

StatusFileSize
new1.44 KB

This one does the real work.

nigelcunningham’s picture

Status: Needs review » Fixed

Applied patch from #5. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.