Permalink
Browse files

Merge pull request #7387 from arcturus/bug-826547

Bug 826547 - STK proactive command Launch Browser does nothing
  • Loading branch information...
2 parents 4de733a + 7c0cbed commit a9c7e415c2a35da5ffd4903007ac563726b16634 @arcturus arcturus committed Jan 9, 2013
Showing with 14 additions and 2 deletions.
  1. +13 −2 apps/settings/js/icc.js
  2. +1 −0 apps/settings/locales/settings.en-US.properties
@@ -212,8 +212,19 @@
responseSTKCommand({
resultCode: icc.STK_RESULT_OK
});
- if (!options.confirmMessage || confirm(options.confirmMessage)) {
- openLink(options.url);
+ var url = 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;
@@ -531,3 +531,4 @@ user-guide=User guide
operatorServices=Operator Services
operatorServices-help=Help
operatorServices-helpmenu=Help menu
+operatorService-invalid-url=Cannot access the URL

0 comments on commit a9c7e41

Please sign in to comment.