summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/common.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/inc/common.php b/inc/common.php
index 25dffdf94..3cacc8ec0 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -986,15 +986,17 @@ function getGoogleQuery(){
$query = array();
parse_str($url['query'],$query);
if(isset($query['q']))
- return $query['q']; // google, live/msn, aol, ask, altavista, alltheweb, gigablast
+ $q = $query['q']; // google, live/msn, aol, ask, altavista, alltheweb, gigablast
elseif(isset($query['p']))
- return $query['p']; // yahoo
+ $q = $query['p']; // yahoo
elseif(isset($query['query']))
- return $query['query']; // lycos, netscape, clusty, hotbot
+ $q = $query['query']; // lycos, netscape, clusty, hotbot
elseif(preg_match("#a9\.com#i",$url['host'])) // a9
- return urldecode(ltrim($url['path'],'/'));
+ $q = urldecode(ltrim($url['path'],'/'));
- return '';
+ if(!$q) return '';
+ $q = join('|',preg_split('/[\s\'"\\\\`()\]\[?:!\.{};,#+*<>\\/]+/',$q,-1,PREG_SPLIT_NO_EMPTY));
+ return $q;
}
/**