[Pkg-mozext-commits] [greasemonkey] 03/12: Fail gracefully when unable to parse the download URL.

David Prévot taffit at moszumanska.debian.org
Wed Jun 11 21:36:15 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository greasemonkey.

commit 1ddf46312573d1ddbb5dc3e52b19cd68cace743c
Author: Anthony Lieuallen <arantius at gmail.com>
Date:   Thu Jun 5 12:13:27 2014 -0400

    Fail gracefully when unable to parse the download URL.
    
    Fixes #1930
---
 modules/script.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/modules/script.js b/modules/script.js
index 7e443c3..b486010 100644
--- a/modules/script.js
+++ b/modules/script.js
@@ -501,7 +501,13 @@ Script.prototype.isRemoteUpdateAllowed = function(aForced) {
 
   var ioService = Components.classes["@mozilla.org/network/io-service;1"]
       .getService(Components.interfaces.nsIIOService);
-  var scheme = ioService.extractScheme(this.downloadURL);
+  try {
+    var scheme = ioService.extractScheme(this.downloadURL);
+  } catch (e) {
+    // Invalid URL, probably an old legacy install.  Do not update.
+    return false;
+  }
+
   switch (scheme) {
   case 'about':
   case 'chrome':
@@ -522,8 +528,6 @@ Script.prototype.isRemoteUpdateAllowed = function(aForced) {
     // Anything not listed: default to not allow.
     return false;
   }
-
-  return true;
 };
 
 Script.prototype.updateFromNewScript = function(newScript, safeWin) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git



More information about the Pkg-mozext-commits mailing list