Reviewed & tested by the community
Project:
Invisimail
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Sep 2009 at 07:58 UTC
Updated:
17 Sep 2020 at 21:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Crell commentedHm. Yeah, that doesn't work. My regex-fu is almost nil, so I probably wouldn't be able to add that myself either. However, I'd accept a patch that does so.
Comment #2
dude4linux commented@Bartezz Do you need to obfuscate the subject and body, or just the e-mail addresses? Might be simpler to do just the latter. I discovered this problem while testing Invisimail using CKEditor to insert the mailto: link. It works as long as the subject and body fields are left blank. I took a look at the code but couldn't figure out where the presence of a '?' would cause the regex match to fail.
Comment #3
bartezz commentedNah I think only email address obfuscation would suffice don't you think? Though what to do with cc= or bcc=
Cheers
Comment #4
dude4linux commentedI figure it has to be one of the special characters in the extended mailto: that is causing the regex to fail, i.e. either ?, &, or =. I tried
and the result was
so I think it must be either the ? or =.
Note: I'm looking at the 6.x version, not the 7.x that this issue belongs to.
Comment #5
bartezz commentedThe original issue by me was in 6.x, Crell changed it to 7.x
My 'regex-fu' also is not legendary... can't really say where the prob lies..
Comment #6
dude4linux commentedThe three regex patterns used by Invisimail assume that the href mailto: address is delimited by quotes ['\"]. I tried adding a '?' to the closing delimiters, i.e. ['\"\?] and it appears to work. By some stroke of luck, the &cc= also works. I presume &bcc works as well, but I didn't test it. I haven't checked the javascript option yet, but will do that next.
Test Results:
I haven't rolled a patch in some time, but if the author thinks it's necessary, I'll give it a try.
Comment #7
dude4linux commentedDecided it was time I learned how to use git to prepare a patch, so here is my first attempt. This patch contains just the mods discussed above in #6.
Comment #8
Crell commentedSince I don't understand the regexes here in the slightest, we will need unit tests for the regexes at least. (The D7 version of the module doesn't have tests yet, but it should be very easy to write tests for it; they can even be UnitTestCase tests, not WebTestCase tests, so that they run in less than an hour.)
Also, this would be for Drupal 7 only. The Drupal 6 version is not taking any new features as the D7 version is a total rewrite.
Comment #9
pjcdawkins commentedI've re-rolled the patch in #7, so it applies to the latest -dev and 1.1 release, because it seems useful. And I've tested it, but manually...
Comment #10
cerr commentedHi,
I just installed invisimail and it works great except, I still doesn't let em specify the subject. I'm using CKEditor and if i specify the subject, this happens:
and like this without the java script:
Comment #11
indigoxela commentedI've applied patch #9 to current stable release 7.x-1.2 and can confirm that it works with email arguments (subject and body).
I'm using filter "Encode email addresses: Javascript-wrapped HTML entities".
Filter "Encode email addresses: HTML entities" is also working fine.
Note: it is absolutely important, that invisimail is the last filter in list.
Comment #12
pjcdawkins commentedComment #13
Ouach commentedThe patch #9 worked for me.
Thanks.
Comment #14
mustanggb commented#9 is not a full re-roll of #7, there are 4 instances that need changing, however #9 only updates 3 of them.
However the missing instance is in $pattern which isn't used anywhere, so I'd say either:
a) Update the missing instance
Or
b) Just remove $pattern altogether
Comment #15
c.nish2k3 commented$pattern is not used. So better to remove it.
Comment #16
mustanggb commentedGreat thanks, looks good and works fine.
Comment #17
TomC commentedVersion 7.x-1.2 appears to have missed out the patch which allows arguments. Checked the code and the $patterns are:
$pattern = "@(?:(]*href=['\"](mailto:$mail)['\"][^>]*>)?((?".">(?]*href=['\"](mailto:$mail)['\"][^>]*>(.*?))@$modifiers";
$pattern_diff_link_text = "@(]*href=['\"](mailto:$mail)['\"][^>]*>(.*?))@$modifiers";
$pattern_same_link_text = "@(?:(]*href=['\"](mailto:$mail)['\"][^>]*>)?((?".">(?
$pattern (e.g.) should read ... href=['\"](mailto:$mail)['\"\?]... etc I believe.
Comment #18
solideogloria commentedI was going to make the comment above readable, but never mind.