Closed Bug 415317 Opened 17 years ago Closed 17 years ago

Search API should accept non-ASCII characters

Categories

(addons.mozilla.org Graveyard :: API, defect)

defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: dev-null, Assigned: laura)

References

()

Details

(Keywords: intl)

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b3pre) Gecko/2008020104 Minefield/3.0b3pre Firefox/3.0b Build Identifier: Search API does not accept non-ASCII characters. Reproducible: Always Steps to Reproduce: 1. Visit https://services.addons.mozilla.org/en-US/firefox/api/search/%E3%81%97%E3%81%84%E3%81%9F%E3%81%91 Actual Results: 400 Bad Request Expected Results: Returns search result. https://addons.mozilla.org/en-US/firefox/search?q=%E3%81%97%E3%81%84%E3%81%9F%E3%81%91 performs search. API should also perform search with non-ASCII characters. It is very important for non-English users.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Assignee: nobody → laura
Status: ASSIGNED → NEW
OS: Mac OS X → All
Hardware: Macintosh → All
Target Milestone: --- → 3.3
Status: NEW → ASSIGNED
Blocks: 404024
Keywords: intl
(In reply to comment #0) > https://addons.mozilla.org/en-US/firefox/search?q=%E3%81%97%E3%81%84%E3%81%9F%E3%81%91 > performs search. > API should also perform search with non-ASCII characters. > It is very important for non-English users. Not sure when and which patch solved this but as far as I tested now this is fixed. Correct result are shown when I search Japanese strings: https://addons.mozilla.org/ja/firefox/search?q=%E3%83%84%E3%83%BC%E3%83%AB%E3%83%90%E3%83%BC&cat=all https://addons.mozilla.org/en-US/firefox/search?q=%E3%81%97%E3%81%84%E3%81%9F%E3%81%91 Please confirm (especially in other languages too).
https://addons.mozilla.org/en-US/firefox/search?q=%E3%81%97%E3%81%84%E3%81%9F%E3%81%91 still returns HTTP 400. ---------- Date: Fri, 13 Jun 2008 02:20:01 GMT Server: Apache/2.2.3 (Red Hat) X-Powered-By: PHP/5.1.6 X-AMO-ServedBy: mrapp09 Content-Length: 0 Connection: close Content-Type: text/html; charset=UTF-8 400 Bad Request
(In reply to comment #3) > https://addons.mozilla.org/en-US/firefox/search?q=%E3%81%97%E3%81%84%E3%81%9F%E3%81%91 > still returns HTTP 400. > ---------- > Date: Fri, 13 Jun 2008 02:20:01 GMT > Server: Apache/2.2.3 (Red Hat) > X-Powered-By: PHP/5.1.6 > X-AMO-ServedBy: mrapp09 > Content-Length: 0 > Connection: close > Content-Type: text/html; charset=UTF-8 > > 400 Bad Request > Can you retest (and, if you still get a bad result, hit shift+control+R to clear your cache)? I get a page with しいたけ in the search box, and showing an extension named "中止ボタンがしいたけに見えて困る", by Hadakadenkyu.
I tested again and now I can see result correctly. But, when searching from Tool - Add-ons still not work.
I tested searching Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9pre) Gecko/2008061008 Minefield/3.0pre According to error console, this search does not work. https://services.addons.mozilla.org/en-US/firefox/api/1.1/search/%E3%81%97%E3%81%84%E3%81%9F%E3%81%91/all/10/WINNT/3.0pre -------------- Date: Fri, 13 Jun 2008 08:05:31 GMT Server: Apache/2.2.3 (Red Hat) X-Powered-By: PHP/5.1.6 X-AMO-ServedBy: mrapp09 Content-Length: 0 Connection: close Content-Type: text/html; charset=UTF-8 400 Bad Request
Should I file issue on Comment 5 and Comment 6 as another bug?
(In reply to comment #2) > (In reply to comment #0) > > https://addons.mozilla.org/en-US/firefox/search?q=%E3%81%97%E3%81%84%E3%81%9F%E3%81%91 > > performs search. > > API should also perform search with non-ASCII characters. > > It is very important for non-English users. > > Not sure when and which patch solved this but as far as I tested now this is > fixed. Correct result are shown when I search Japanese strings: > https://addons.mozilla.org/ja/firefox/search?q=%E3%83%84%E3%83%BC%E3%83%AB%E3%83%90%E3%83%BC&cat=all > https://addons.mozilla.org/en-US/firefox/search?q=%E3%81%97%E3%81%84%E3%81%9F%E3%81%91 I said, such a query performs search, i.e. works fine. This is not problem. The problem is mentioned in "Steps to Reproduce:."
(In reply to comment #8) > I said, such a query performs search, i.e. works fine. This is not problem. > The problem is mentioned in "Steps to Reproduce:." I misunderstood sorry. API *also* have to support non-ascii.
Target Milestone: 3.3 → 3.4.5
laura: I think this is due to the XSS check in bootstrap.php in bootstrap.php (line 114) there is an XSS check that throws a HTTP 400, it contains... preg_match('/[^\w\d\/\.\-_!: ]/',$_GET['url']) testing that with one of the faulty URLs above I got 1 match, which would cause the fail not sure how to fix, maybe use utf characters in the preg_match?
Attachment #328436 - Flags: review?(morgamic)
After applying the patch, I still don't get results for this: http://morgamic.khan.mozilla.org/amo/site/en-US/firefox/api/1.1/search/%E3%81%97%E3%81%84%E3%81%9F%E3%81%91/all/10/WINNT/3.0pre Though I do not get the 400 -- which is the patch meant to fix?
Just the 400. If you search for that term via regular AMO search, you'll get no results.
Comment on attachment 328436 [details] [diff] [review] Patch to avoid applying this test to API urls Ok, that's the behavior I saw.
Attachment #328436 - Flags: review?(morgamic) → review+
In r16794.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Keywords: push-needed
Resolution: --- → FIXED
Going to https://preview.addons.mozilla.org/en-US/firefox/api/search/%E3%81%97%E3%81%84%E3%81%9F%E3%81%91 returns and XML file with no search results (expected), vs https://services.addons.mozilla.org/en-US/firefox/api/search/%E3%81%97%E3%81%84%E3%81%9F%E3%81%91 which returns an HTTP error 400 (or a blank page in most browsers). VERIFIED.
Status: RESOLVED → VERIFIED
Filed bug 444522 as a follow up.
3.4.5 was pushed on Friday.
Keywords: push-needed
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: