mkranz
Forum Replies Created
-
Forum: Plugins
In reply to: [Pixeline's Email Protector] Partly identical addresses may not be caughtThanks for the response.
To get this problem to trigger, you actually need two similar address (one which is, effectively, a substring of the other).
Just to continue using the same examples as above, if you were to have two email addresses on the same page:
[email protected]
[email protected]“[email protected]” would be turned into a mailto link in both cases, with the second email having the letters “boo” as just simple html to the left of the “[email protected]” mailto link.
The simple suggestion @pdaengeli suggested, which I tested locally and seems to work great, is to sort all of the email addresses in the “pep_replace” function by string length.
I added the following after the line declaring the “$the_addrs” array and before the “for” statement:
usort( $the_addrs, function( $a, $b ){
return strlen( $b ) – strlen( $a );
});This way, as the pep_replace function cycles through emails to find a match, it looks for the longest match first, avoiding matching any substrings within a match.
I’ll also drop a similar thing in TRAC repo. Thanks for the tip!
Forum: Plugins
In reply to: [Pixeline's Email Protector] Partly identical addresses may not be caughtThanks for the quick response, @pdaengeli.
I did manage to find the offending piece… it just does a search replace for the particular string, so, if you do sort from the longest to the shortest, I could see how that would work. Going to try it out on my end. Is there anywhere from which to fork this? I found a Git repo, but it’s empty.Forum: Plugins
In reply to: [Pixeline's Email Protector] Partly identical addresses may not be caughtI’m also having this issue… more with a [email protected] and [email protected] both showing up as [email protected], but it’s the same issue.
Unfortunately, I’m not of much help, but, if I find a resolution, I’ll try to post it here. Did either of you figure any way around this problem?