0tza / gmail-delay-send

Automatically exported from code.google.com/p/gmail-delay-send
0 stars 0 forks source link

Delimiter cannot contain Regex special characters #88

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In Gmail Delay Send Settings change the delimiter to >>
2. Compose an email with in the body the text ">>" and some time specification 
in the future.
3. Save the email.

What is the expected output? What do you see instead?
1. Expected: Email is sent at specific time.
2. Actual: Email is never sent.

What version of the product are you using? On what operating system?
https://code.google.com/p/gmail-delay-send/wiki/GmailDelaySendTransition_8

Please provide any additional information below.
1. If you change the delimiter to "!!" for example, it runs fine. This leads me 
to assume that the reason why ">>" does not work is because ">" is a special 
regex character.

Original issue reported on code.google.com by guillaum...@gmail.com on 9 Jul 2013 at 7:45

GoogleCodeExporter commented 9 years ago
Hello guillaumehanique,

Yep! you found another bug  :-)

I've thought about trying to throw an error or some kind of a warning before 
but I'm surprised nobody has noticed up until now.

I found this function for escaping chars: 
http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-r
egex

But (you've already proven you're knowledge of this stuff so I'm not 
questioning you) but I didn't think > was special regex chars?

http://www.w3schools.com/jsref/jsref_obj_regexp.asp

Original comment by blairk...@gmail.com on 9 Jul 2013 at 8:34

GoogleCodeExporter commented 9 years ago
Hi,

(?<Name>) is a named capture.
(?<n1-n2>) is a balancing group.
(?<=) means: match prefix but exclude it.

So the problem with < and > may be that they may not always need to be
escaped... (I'm not sure).

I'm not really sure how to fix it yet... Perhaps in time I'll check out
your source code and have a look at it. You're parsing messages in a
different way than in the previous version, which takes me some more time
to comprehend than I have now.

Thanks!

Original comment by guillaum...@gmail.com on 10 Jul 2013 at 7:22

GoogleCodeExporter commented 9 years ago
As far as I can tell, javascript doesn't support those regex expressions.

I think the issue for Gmail Delay Send was that a character like '<' was being 
HTML escaped (eg. lt&).

cl/175eccce2565 escapes these characters when parsing and puts in a check to 
not allow things such as ?, $, \ etc. into the delim.

Thanks for the report!
-Blair

Original comment by blairk...@gmail.com on 19 Oct 2013 at 12:38