Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5462] Hash in url when using openURL gets escaped - 1.7.2 / 1.8.x

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionInvalid
Resolution Date2011-10-11T10:28:50.000+0000
Affected Version/sRelease 1.7.2, Release 1.8.0
Fix Version/sSprint 2011-41
ComponentsiOS
Labelsn/a
ReporterEduardo Gomez
AssigneeQing Gao
Created2011-10-06T16:19:48.000+0000
Updated2017-03-02T22:20:37.000+0000

Description

Problem

Titanium.Platform.openURL method causes the url to break if URL is escaped with special characters. e.g. http://mobile.twitter.com/?status=the free mom's Helper app from Fisher-Price That will show: the free mom

Repro sequence

//If URL has an apostrophe shows like &# 39 ; Titanium.Platform.openURL("http://mobile.twitter.com/?status=the free mom's Helper app from Fisher-Price");

Tested on

iOS Simulator & iPad 2 v4.3.3

Associated HD ticket

APP-619486

Comments

  1. Eduardo Gomez 2011-10-06

    None of these scape characters worked, to show an apostrophe {noformat} U+0027; /U0027 ’ ’ ’ ' &39; ‘   %27  {noformat}
  2. Reggie Seagraves 2011-10-10

    The client code should be properly encoding the URL before passing it to the openURL API using Ti.Network.encodeURIComponent.
  3. Qing Gao 2011-10-11

    We can solve this problem by two steps. 1. Use the following defined fixedEncodeURIComponent function to replaced some Unescaped characters with their encoded code. function fixedEncodeURIComponent (str) { return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28'). replace(/\)/g, '%29').replace(/\*/g, '%2A'); } 2. Replace "mobile.twitter.com" with "twitter.com" in the URL.
  4. Lee Morris 2017-03-02

    Closing ticket as invalid.

JSON Source