Closed Bug 954650 Opened 10 years ago Closed 10 years ago

Search API queries need some escaping

Categories

(Chat Core :: Twitter, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: florian, Assigned: clokep)

Details

(Whiteboard: [1.2-wanted])

Attachments

(1 file, 1 obsolete file)

*** Original post on bio 1218 at 2012-01-02 18:36:00 UTC ***

Warning: sending request to http://search.twitter.com/search.json?q=#fail&since_id=153821308789071873 (POSTData = )
Source File: resource:///modules/http.jsm
Line: 110
Source Code:
xhr: doXHRequest

Warning: Received response: {"error":"You must enter a query."}
Source File: resource:///modules/http.jsm
Line: 80
Source Code:
xhr
Whiteboard: [1.2-wanted]
Attached patch Simple fix v1 (obsolete) — Splinter Review
*** Original post on bio 1218 as attmnt 1121 at 2012-01-16 21:15:00 UTC ***

This simply percent encodes the get parameters we send for the track keyword.
Attachment #8352864 - Flags: review?(florian)
Assignee: nobody → clokep
Status: NEW → ASSIGNED
Attached patch Simpler fix v2Splinter Review
*** Original post on bio 1218 as attmnt 1122 at 2012-01-16 22:10:00 UTC ***

This does a pure encodeURIComponent instead of the extra percent encodings (which seems to be what twitter.com/search uses).

flo suggested using encodeURIComponent(track).split(","), but that doesn't work because , is percent encoded into %2C. This seemed to be the easiest solution.
Attachment #8352865 - Flags: review?(florian)
Comment on attachment 8352864 [details] [diff] [review]
Simple fix v1

*** Original change on bio 1218 attmnt 1121 at 2012-01-16 22:10:56 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8352864 - Attachment is obsolete: true
Attachment #8352864 - Flags: review?(florian)
Comment on attachment 8352865 [details] [diff] [review]
Simpler fix v2

*** Original change on bio 1218 attmnt 1122 at 2012-06-10 20:41:21 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8352865 - Flags: review?(florian) → review+
*** Original post on bio 1218 at 2012-06-10 21:06:12 UTC ***

Checked in as http://hg.instantbird.org/instantbird/rev/7bfe729f1a58
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
OS: Other → All
Hardware: x86 → All
Resolution: --- → FIXED
Target Milestone: --- → 1.2
You need to log in before you can comment on or make changes to this bug.