[Pkg-mozext-commits] [adblock-plus-element-hiding-helper] 310/483: Fixed: Broken composer dialog with composer_defaultDomain 1 or 2 if host name is an IP address

David Prévot taffit at moszumanska.debian.org
Thu Jan 22 21:41:51 UTC 2015


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

taffit pushed a commit to branch master
in repository adblock-plus-element-hiding-helper.

commit 1e95d5f2079600c612aad1ee6a5a05d39a8d0956
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Fri Mar 11 15:23:14 2011 +0100

    Fixed: Broken composer dialog with composer_defaultDomain 1 or 2 if host name is an IP address
---
 chrome/content/composer.js | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/chrome/content/composer.js b/chrome/content/composer.js
index d4dba20..894d6a9 100644
--- a/chrome/content/composer.js
+++ b/chrome/content/composer.js
@@ -202,17 +202,21 @@ function init() {
       selectedDomain = "";
       break;
     case 1:
-    {
-      let effectiveTLD = Cc["@mozilla.org/network/effective-tld-service;1"].getService(Ci.nsIEffectiveTLDService);
-      selectedDomain = effectiveTLD.getPublicSuffixFromHost(domain);
-      break;
-    }
+      try
+      {
+        // EffectiveTLDService will throw for IP addresses, just go to the next case then
+        let effectiveTLD = Cc["@mozilla.org/network/effective-tld-service;1"].getService(Ci.nsIEffectiveTLDService);
+        selectedDomain = effectiveTLD.getPublicSuffixFromHost(domain);
+        break;
+      } catch (e) {}
     case 2:
-    {
-      let effectiveTLD = Cc["@mozilla.org/network/effective-tld-service;1"].getService(Ci.nsIEffectiveTLDService);
-      selectedDomain = effectiveTLD.getBaseDomainFromHost(domain);
-      break;
-    }
+      try
+      {
+        // EffectiveTLDService will throw for IP addresses, just go to the next case then
+        let effectiveTLD = Cc["@mozilla.org/network/effective-tld-service;1"].getService(Ci.nsIEffectiveTLDService);
+        selectedDomain = effectiveTLD.getBaseDomainFromHost(domain);
+        break;
+      } catch (e) {}
     case 3:
       selectedDomain = domain.replace(/^www\./, "");
       break;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus-element-hiding-helper.git



More information about the Pkg-mozext-commits mailing list