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

mikeperry at torproject.org mikeperry at torproject.org
Fri Apr 9 22:54:00 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: 2d88d9b40f949e180321dc708feaf27863639a49

---
 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 0a37566..2ccbe8f 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -2821,7 +2821,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);
@@ -3163,7 +3163,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.6.5




More information about the tor-commits mailing list