Last modified: 2011-03-08 20:35:28 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29848, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27848 - Escape '-' in $.escapeRE()
Escape '-' in $.escapeRE()
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.17.x
All All
: Normal normal (vote)
: ---
Assigned To: Krinkle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-04 12:25 UTC by Helder
Modified: 2011-03-08 20:35 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Helder 2011-03-04 12:25:53 UTC
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?
Comment 1 Helder 2011-03-04 12:46:50 UTC
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...).
Comment 2 Krinkle 2011-03-05 14:26:06 UTC
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
Comment 3 Krinkle 2011-03-05 14:47:07 UTC
Fixed in r83284. Will tag for backporting to 1.17.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links