Skip to content

Commit

Permalink
Bug 826547 - STK proactive command Launch Browser does nothing
Browse files Browse the repository at this point in the history
Preventing urls that are not matching the web activity to be launched
  • Loading branch information
arcturus committed Jan 9, 2013
1 parent a069d55 commit 7c0cbed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 13 additions & 2 deletions apps/settings/js/icc.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -212,8 +212,19 @@
responseSTKCommand({ responseSTKCommand({
resultCode: icc.STK_RESULT_OK resultCode: icc.STK_RESULT_OK
}); });
if (!options.confirmMessage || confirm(options.confirmMessage)) { var url = options.url;
openLink(options.url); if (url !== null && url.length !== 0) {
if (!options.confirmMessage || confirm(options.confirmMessage)) {
// Sanitise url just in case it doesn't start with http or https
// the web activity won't work, so add by default the http protocol
if (url.search("^https?://") == -1) {
// Our url doesn't contains the protocol
url = 'http://' + url;
}
openLink(url);
}
} else {
alert(_('operatorService-invalid-url'));
} }
break; break;


Expand Down
1 change: 1 addition & 0 deletions apps/settings/locales/settings.en-US.properties
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -530,3 +530,4 @@ user-guide=User guide
operatorServices=Operator Services operatorServices=Operator Services
operatorServices-help=Help operatorServices-help=Help
operatorServices-helpmenu=Help menu operatorServices-helpmenu=Help menu
operatorService-invalid-url=Cannot access the URL

0 comments on commit 7c0cbed

Please sign in to comment.