[or-cvs] [torbutton/master 22/47] Woops, we did the regex wrong for the query.

mikeperry at torproject.org mikeperry at torproject.org
Thu Sep 30 16:20:14 UTC 2010


Author: Mike Perry <mikeperry-git at fscked.org>
Date: Wed, 31 Mar 2010 05:57:11 -0700
Subject: Woops, we did the regex wrong for the query.
Commit: 1b097e332ba1dc1372fb3357d4f8141c8ce35604

---
 src/chrome/content/torbutton.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index b3292bf..34bb3a1 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -2731,7 +2731,7 @@ function torbutton_check_google_captcha(subject, topic, data) {
                   subject.URI.originCharset, null);
     redirURI = redirURI.QueryInterface(Components.interfaces.nsIURI);
     if (redirURI.host == "sorry.google.com") {
-      querymatch = subject.URI.path.match("[\?\&]q=([^&]+)[\&]");
+      querymatch = subject.URI.path.match("[\?\&]q=([^&]+)(?:[\&]|$)");
       if (!querymatch) {
         torbutton_safelog(4, "No Google query found for captcha in: ",
                 subject.URI.spec);
@@ -3073,7 +3073,7 @@ function torbutton_wrap_search_service()
           return sub;
         }
 
-        var querymatch = sub.uri.path.match("[\?\&](q=[^&]+)[\&]")[1];
+        var querymatch = sub.uri.path.match("[\?\&](q=[^&]+)(?:[\&]|$)")[1];
         var querypath = sub.uri.path.split("?")[0];
         torbutton_log(3, "Got submission call to Google search.");
 
-- 
1.7.1




More information about the tor-commits mailing list