Download & Extend

Should ReCAPTCHA Mailhide Hide a href mailto: addresses also?

Project:reCAPTCHA
Version:6.x-1.x-dev
Component:reCAPTCHA Mailhide
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Hey, I don't know if maybe mailhide is clashing with another filter or something, but if I type a raw address in the text of a story node, say like test@example.com, I get the mailhide feature (which rocks by the way).

But if I enclose the mail as a link:

<a href="mailto:test@example.com">testing</a>

It doesn't seem to see this as an email to be hidden. This would be great because I have a lot of very old content I've converted to drupal that enclosed emails in this fashion... (from the days before text filters) ... It would be cool if the world "testing" above could link to the mailhidden address instead...

Don't know if this is a bug, a feature request, a fixed or a won't fix... but I'd love it if it worked...

Thanks in advance!

W

Comments

#1

So, before the reCAPTCHA Mailhide filter goes through, replace tags that reference mailto:// protocols with just the email address. The Mailhide would than run on it, replacing the email addresses. Neat idea, and it would allow reCAPTCHA Mailhide to run after/with the URL/Email filter. The tricky thing to do would be to write the regex for it.

#2

exactly.... and yes the regular expression will be a bitch to get right I'm sure, but it would be a great feature that would go a long way with the many years of imported content... but I bet someone has already written the regex code to extract the "meat" out of an http:// mailto and then it's just a matter of switching the elements around.. (probably easier said than done :) )

W

#3

Version:5.x-2.3» 6.x-1.x-dev

I think it should. The whole point of the recaptcha mailhide module is to protect people's email addresses. Until it can hide <a> with mailto addresses, it's not doing the job...

#4

I'm having the same issue. Email addresses surrounded by spaces or a pre-defined (and hard-coded) set of tags work fine; any other markup causes the preg_replace_callback function to not see it.

What about a two-step process? First, pre-scan the text, which does nothing but search for anything that looks like an email address (regardless of surrounding markup) and puts some custom delimiter around them? Second, feed that to the existing function and let it substitute based on the custom delimiters.

It could even strip out the mailto: from hrefs on the way, although in this case the entire URL would be substituted instead of just the middle of the existing email address.

Disclaimer: My regular expression expertise is virtually nil. I know enough to know that regexes can do this but not how to make them do so. (And to think I used to be able to write APL!)

#5

I'm seeing really spotty performance. Mailhide does nothing at all for addresses that are written using anchor tags (which is really problematic, to my mind)

Furthermore, it processes plain-text unlinked email addresses in an inconsistent way. E.g., given the gmail address example@gmail.com, what's rendered is "example...gmail.com", where "..." is linked and produces the Mailhide popup.

Can't use this for production if this is the normal behavior. It's too unreliable.

#6

Yup I think it should - particularly as a lot of editors automatically convert email addresses into links so actually the data entry is about out of the editors hands, does make it kinda pointless otherwise

....subscribe!

C

#7

Hey guys, don't blame reCaptcha. I figured out how to hide the mailto: with reCaptcha.
Go to your recaptcha account and click on "email protection".
Enter the email address you want to protect in the field and click "protect it", next copy the html code.
This code is what you're gonna place into the mailto: link.

Here's what it should look like:

<a href="mailto:name@youremail.com">captcha email html code</a>

Note: be sure to remove the </a> before the latter half of your email from the "captcha email html code"

Here's an example of what it should look like @ My Website And since you're there shoot me an email letting me know you got it.

All thanks goes to Google recaptcha

Wayne

#8

Yes this does work but that's not quite the point....

The issue is that the module does not protect email addresses in content when the already have an anchor tag around them. Client using a wysiwyg modules don't want to do this every time they put an email address into a piece of text.

The point is the filter should correct all the content on the way out to the browser not just email addresses that are not a link.

....if that makes sense.

C

#9

subscribing... Yes would be nice if the filter handled it. Dont know anyone that leaves emails as raw text vs mailto:'s.