Page MenuHomePhabricator

Escape '-' in $.escapeRE()
Closed, ResolvedPublic

Description

Currently, the function $.escapeRE() (from r75552) doesn't escape these characters: ^$

Since they have special meaning in regular expressions, I think they should be added to the list of characters to be escaped by the function.

What do you think?


Version: 1.17.x
Severity: normal

Details

Reference
bz27848

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:32 PM
bzimport set Reference to bz27848.

Correction: The function is not escaping the following character "-'.

See also:
http://code.extjs.com:8080/ext/ticket/14?version=9

(I don't know why, but I didn't see the characters above in the first time I looked at the code. I'm sorry for that mistake...).

Both in trunk and in REL1_17 branch the following returns:

$.escapeRE( '$^' );

< "\$\^"

The minus character is unescaped in both the 1.17 release branch and in the development trunk.
Thanks for the bug report ! I'll fix this right away!

Krinkle

Fixed in r83284. Will tag for backporting to 1.17.