diff options
author | Andreas Gohr <andi@splitbrain.org> | 2008-02-15 18:58:16 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2008-02-15 18:58:16 +0100 |
commit | f93b3b503d8e2938a107d1c12bed1fd65308f933 (patch) | |
tree | bc2abed6cc8c12e9dba684530f8d66a44a3fc42d | |
parent | 60c15d7deb9c53bcb1cf7881f441744bb29a6b63 (diff) | |
download | rpg-f93b3b503d8e2938a107d1c12bed1fd65308f933.tar.gz rpg-f93b3b503d8e2938a107d1c12bed1fd65308f933.tar.bz2 |
fix highlighting of search engine referer keywords for recent highlight change
darcs-hash:20080215175816-7ad00-f12f54210dceacf4b3580e78b2f86a21a23b4315.gz
-rw-r--r-- | inc/common.php | 12 |
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; } /** |