{ "id": "62584", "key": "TIMOB-1952", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11225", "name": "Release 1.5.0", "archived": true, "released": true, "releaseDate": "2010-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:57:38.000+0000", "created": "2011-04-15T03:06:23.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android", "defect" ], "versions": [], "issuelinks": [], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2011-04-17T01:57:38.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}

cf this commit:

\n

\nhttp://github.com/appcelerator/titanium_mobile/commit/768616c5f7595...

\n

We've had a problem in the past with partially escaped query\nstrings -- unfortunately that commit referenced above does not\nitself reference a ticket. Anyway, because of partially escaped\nquery strings, we unescape and then re-escape the query string in\norder to ensure the full string is escaped. But in re-escaping, we\ndo not escape the ampersand because of its status as a field\nseparator. But now this unescape/re-escape causes a problem for\nquery strings that really did want the ampersand escaped.

\n

Fail case app.js:

\n
\nvar URL = \"http://www.google.com/m/search?q=test%26junk\";\nTitanium.UI.setBackgroundColor('#000');\nvar xhr = Ti.Network.createHTTPClient();\nxhr.open('GET', URL);\nxhr.send();\nTi.API.info(xhr.location);\n
\n

When you run that, on the console you'll see that the url\nbecomes\nhttp://www.google.com/m/search?q=test&junk, when\nit's expected to have that ampersand stay as %26.

{html}", "attachment": [], "flagged": false, "summary": "Android: Escaped ampersand in URI query string gets unescaped thus breaking XHR calls", "creator": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "127067", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

Actually an earlier commit references ticket #1491 and\nhelpdesk http://developer.appcelerator.com/helpdesk/view/34201

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:06:23.000+0000", "updated": "2011-04-15T03:06:23.000+0000" }, { "id": "127068", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [34363f9c2020a21cd4038c9160cce39b38a8c1b3])\n[#1952 state:fixed-in-qa] If user (developer)\nsupplies escaped characters (%xx) in query string, don't encode the\nuri \nhttp://github.com/appcelerator/titanium_mobile/commit/34363f9c2020a...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:06:23.000+0000", "updated": "2011-04-15T03:06:23.000+0000" }, { "id": "127069", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

1.4.2.4ce7ff G1 running 1.6, 2.2 simulator

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:06:24.000+0000", "updated": "2011-04-15T03:06:24.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }