[Pkg-mozext-commits] [greasemonkey] 16/25: Ignore user/pass in URLs again.

David Prévot taffit at moszumanska.debian.org
Wed Sep 17 21:14:01 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 f323c9fe5d8782dcd248ea7233173649d46f35f9
Author: Anthony Lieuallen <arantius at gmail.com>
Date:   Mon Aug 25 15:17:47 2014 -0400

    Ignore user/pass in URLs again.
    
    Fixes #2001
    
    Refs #1970
    Refs #1631
---
 components/greasemonkey.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/components/greasemonkey.js b/components/greasemonkey.js
index 659284b..92cb5a5 100644
--- a/components/greasemonkey.js
+++ b/components/greasemonkey.js
@@ -39,6 +39,8 @@ var gTmpDir = Components.classes["@mozilla.org/file/directory_service;1"]
     .getService(Components.interfaces.nsIProperties)
     .get("TmpD", Components.interfaces.nsIFile);
 
+var gStripUserPassRegexp = new RegExp('(://)([^:/]+)(:[^@/]+)?@');
+
 /////////////////////// Component-global Helper Functions //////////////////////
 
 // TODO: Remove this, see #1318.
@@ -442,6 +444,8 @@ service.prototype.runScripts = function(aRunWhen, aWrappedContentWin) {
   // be consistent is to ignore it.  Luckily, the  document.documentURI does
   // _not_ change, so always use it when deciding whether to run scripts.
   var url = aWrappedContentWin.document.documentURI;
+  // But ( #1631 ) ignore user/pass in the URL.
+  url = url.replace(gStripUserPassRegexp, '$1');
 
   if (!GM_util.getEnabled() || !GM_util.isGreasemonkeyable(url)) return;
 

-- 
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