Closed Bug 427304 Opened 16 years ago Closed 16 years ago

Cannot search with non-ascii characters (nsURLFormatter wrongly parses encoded uri)

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9

People

(Reporter: kohei, Assigned: kohei)

References

Details

(Keywords: intl)

Attachments

(3 files, 1 obsolete file)

Attached patch fixSplinter Review
Steps to Reproduce:

1. Enable HTTP Logging (http://developer.mozilla.org/en/docs/HTTP_Logging)
2. Run Firefox
3. Open Add-ons Manager
4. Type タブ in the search box
5. Type ツールバー in the search box
6. Check the log file for the search URLs

Actual Results:

https://services.addons.mozilla.org/en-US/firefox/api/1/search/%E3%82E3%83%96/all/10/Darwin/3.0pre
https://services.addons.mozilla.org/en-US/firefox/api/1/search/%E3%83%84%E3%83E3%83E3%83%90%E3%83%BC/all/10/Darwin/3.0pre

Expected Results:

https://services.addons.mozilla.org/en-US/firefox/api/1/search/%E3%82%BF%E3%83%96/all/10/Darwin/3.0pre
https://services.addons.mozilla.org/en-US/firefox/api/1/search/%E3%83%84%E3%83%BC%E3%83%AB%E3%83%90%E3%83%BC/all/10/Darwin/3.0pre

Additional Information:

nsURLFormatter.js formatURL() doesn't consider encoded uri.
Flags: blocking-firefox3?
Attachment #313861 - Flags: review?(dtownsend)
Attachment #313862 - Flags: review?(dtownsend)
Comment on attachment 313861 [details] [diff] [review]
fix

I am not a valid reviewer for this component. Maybe Gavin?

My only thought would be maybe the regex should only match sequences longer than 2 characters but that would break the ID case anyway.

Also it could do with a unit test I think.
Attachment #313861 - Flags: review?(dtownsend) → review?(gavin.sharp)
Attachment #313862 - Flags: review?(dtownsend)
Here is a dump in the formatURL():

aMatch: %LOCALE%
aMatch: %LOCALE%
aMatch: %APP%
aMatch: %LOCALE%
aMatch: %APP%
aMatch: %BF% <- should not be cut off 
aMatch: %OS%
aMatch: %VERSION%
aMatch: %LOCALE%
aMatch: %BF% <- ditto.
aMatch: %OS%
aMatch: %VERSION%
Blocks: 404024
Comment on attachment 313861 [details] [diff] [review]
fix

Please add a test for this to toolkit/components/urlformatter/tests/unit/test_urlformatter.js .
Attachment #313861 - Flags: review?(gavin.sharp) → review+
Assignee: nobody → kohei.yoshino.bugs
Flags: in-testsuite?
Status: NEW → ASSIGNED
Flags: blocking-firefox3? → blocking-firefox3+
Whiteboard: [has patch][has reviews]
Attachment #313861 - Flags: approval1.9?
Comment on attachment 313861 [details] [diff] [review]
fix

a=beltzner, please do file that test as well
Attachment #313861 - Flags: approval1.9? → approval1.9+
What is happening with this, why has it not landed yet?
Attached patch unit test (obsolete) — Splinter Review
Nakano-san, please check-in this and the patch for me.
Attached patch unit test, fixedSplinter Review
Added a missing dot in encodedUrlRef.
Attachment #317188 - Attachment is obsolete: true
Whiteboard: [has patch][has reviews] → [has patch][has reviews][has approval]
checked-in the patch and the test.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Flags: in-testsuite? → in-testsuite+
Whiteboard: [has patch][has reviews][has approval]
Target Milestone: --- → Firefox 3
Verified.

Note that the search with non-ascii chars is still broken due to bug 415317.

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9pre) Gecko/2008042404 Minefield/3.0pre
Status: RESOLVED → VERIFIED
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: