Closed
Bug 856913
Opened 13 years ago
Closed 13 years ago
MatchPattern incorrectly matches patterns with wildcard
Categories
(Add-on SDK Graveyard :: General, defect, P2)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla23
People
(Reporter: fxrock2002, Assigned: jsantell)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.70 Safari/537.17
Steps to reproduce:
According to the match-pattern documentation:
"A domain name prefixed with an asterisk and dot matches any URL of that domain or a subdomain, using any of http, https, ftp."
However, I have a MatchPattern setup to match "*.ign.com" and ANYTHING that ends in ign.com is matched. For example: design.com is matched, and even activesouldesign.com is matched. These are not subdomains of ign.com. A regular expression would be a workaround, but this defeats the purpose of having wildcards as an alternative for developer ease-of-use.
https://addons.mozilla.org/en-US/developers/docs/sdk/latest/modules/sdk/page-mod/match-pattern.html
Actual results:
console.log(new MatchPattern('*.ign.com').test('http://ign.com')); // true
console.log(new MatchPattern('*.ign.com').test('http://www.ign.com')); // true
console.log(new MatchPattern('*.ign.com').test('http://www.design.com')); // true
console.log(new MatchPattern('*.ign.com').test('http://activesouldesign.com')); // true
Expected results:
console.log(new MatchPattern('*.ign.com').test('http://ign.com')); // true
console.log(new MatchPattern('*.ign.com').test('http://www.ign.com')); // true
console.log(new MatchPattern('*.ign.com').test('http://www.design.com')); // false
console.log(new MatchPattern('*.ign.com').test('http://activesouldesign.com')); // false
| Assignee | ||
Updated•13 years ago
|
Assignee: nobody → jsantell
Priority: -- → P2
| Assignee | ||
Comment 1•13 years ago
|
||
Thanks fxrock, the following tests will now correctly fail once patched
ok('*.ign.com', 'http://www.design.com');
ok('*.ign.com', 'http://design.com');
ok('*.zilla.com', 'http://bugzilla.mozilla.com');
ok('*.zilla.com', 'http://mo-zilla.com');
| Assignee | ||
Comment 2•13 years ago
|
||
| Assignee | ||
Comment 3•13 years ago
|
||
Attachment #733497 -
Flags: review?(zer0)
Comment 4•13 years ago
|
||
Comment on attachment 733497 [details]
GH Pull Request 923
Good catch! But I see some issues in your implementation. Take a look to the comments I wrote on Github.
Attachment #733497 -
Flags: review?(zer0) → review-
| Assignee | ||
Comment 5•13 years ago
|
||
Attachment #733715 -
Flags: review?(zer0)
Updated•13 years ago
|
Attachment #733715 -
Flags: review?(zer0) → review+
Comment 6•13 years ago
|
||
Commit pushed to master at https://github.com/mozilla/addon-sdk
https://github.com/mozilla/addon-sdk/commit/f36c6dac5ad2ac4c3757b17b157f162614cc8591
Merge pull request #923 from jsantell/fix-matchpattern-856913
Fix Bug 856913, fix match pattern wildcard to not match invalid domains, r=@ZER0
Updated•13 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 7•12 years ago
|
||
Still experiencing this bug with the latest add-on sdk 1.14 and firefox 22. How can I see what version the fix will be included in?
I believe this landed for Firefox 23, and the version of this file in the the Firefox23 branch of the SDK looks like it contains this patch: https://github.com/mozilla/addon-sdk/blob/firefox23/lib/sdk/page-mod/match-pattern.js
Target Milestone: --- → mozilla23
Comment 9•10 years ago
|
||
dies ist Geburtstagswünsche Blog. hier finden Sie am besten Zitate, sms für Wunsch, den Ihr Freund, ein Familienmitglied und alle Ihre liebevolle Person erhalten
<a href="http://www.geburtstagswuensche4u.com/">Geburtstagswünsche</a>
You need to log in
before you can comment on or make changes to this bug.
Description
•