From 95a6e3d1714b7511fce8894680672caa37c542fa Mon Sep 17 00:00:00 2001 From: rboren Date: Tue, 1 Jun 2004 02:18:36 +0000 Subject: [PATCH] HTTP_REFERER fixes from Joseph Scott. http://wordpress.org/support/6/6657 git-svn-id: http://svn.automattic.com/wordpress/trunk@1378 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/plugins/google-hilite.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-content/plugins/google-hilite.php b/wp-content/plugins/google-hilite.php index 20bd904ad..038d9376a 100644 --- a/wp-content/plugins/google-hilite.php +++ b/wp-content/plugins/google-hilite.php @@ -11,7 +11,7 @@ Author URI: http://rboren.nu /* Highlighting code c/o Ryan Boren */ function get_search_query_terms($engine = 'google') { global $s, $s_array; - $referer = urldecode($_SERVER[HTTP_REFERER]); + $referer = urldecode($_SERVER['HTTP_REFERER']); $query_array = array(); switch ($engine) { case 'google': @@ -58,6 +58,9 @@ function get_search_query_terms($engine = 'google') { function is_referer_search_engine($engine = 'google') { $siteurl = get_settings('home'); + if( empty($_SERVER['HTTP_REFERER']) ) { + return 0; + } $referer = urldecode($_SERVER['HTTP_REFERER']); //echo "referer is: $referer
"; if ( ! $engine ) { @@ -131,4 +134,4 @@ add_filter('the_content', 'hilite'); add_filter('comment_text', 'hilite'); add_action('wp_head', 'hilite_head'); -?> \ No newline at end of file +?>