Closed
Bug 117931
Opened 24 years ago
Closed 24 years ago
Function shExpMatch in nsProxyAutoConfig.js: conversion from shell pattern to regexp is incorrect.
Categories
(Core :: Networking, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla0.9.8
People
(Reporter: zybi, Assigned: zybi)
Details
(Whiteboard: [ready to land])
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7) Gecko/20011221
BuildID: 2001122108
E.g. currently pattern "abc*" will match "xxabcd", but shouldn't.
When converting shell pattern to regexp, pattern should be surrounded by "^" and
"$".
E.g. "abc*" should be converted to "^abc.*$", but is "abc.*".
Reproducible: Always
Steps to Reproduce:
1.The simplest way is to look into components/nsProxyAutoConfig.js starting from
line 276 and recall how regular expressions differ from shell patterns.
Here is my patch:
--- components/nsProxyAutoConfig.js-orig Fri Sep 28 22:09:02 2001
+++ components/nsProxyAutoConfig.js Thu Jan 3 15:14:28 2002
@@ -277,7 +277,7 @@
" pattern = pattern.replace(/\\./g, '\\\\.');\n" +
" pattern = pattern.replace(/\\*/g, '.*');\n" +
" pattern = pattern.replace(/\\?/g, '.');\n" +
-" var newRe = new RegExp(pattern);\n" +
+" var newRe = new RegExp('^'+pattern+'$');\n" +
" return newRe.test(url);\n" +
"}\n" +
Updated•24 years ago
|
Comment 2•24 years ago
|
||
patch looks correct to me, but cc'ing some other folks who may know better.
Status: NEW → ASSIGNED
Comment 3•24 years ago
|
||
This makes a lot of sense.
I don't know if if my review is good for PAC code (about the only place in
netwerk/ that it might be), but if so r=tingley.
Comment 4•24 years ago
|
||
sr=darin, i'll check this in when the tree opens.
Comment 5•24 years ago
|
||
-> 0.9.8 (so i don't forget this one)
Priority: -- → P3
Target Milestone: --- → mozilla0.9.8
Updated•24 years ago
|
Whiteboard: [ready to land]
Comment 7•24 years ago
|
||
fixed-on-trunk
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•