Today I found a nice plugin for highlighting searchstrings from referer called google-highlight, when coming from a search engine. The problem was, when the site includes a substring of $_SERVER["SERVER_NAME"] it was highlighted … maybe not what you want.
Here is the patch:
--- /tmp/google-hilite.php 2005-06-17 02:36:02.000000000 +0200
+++ /usr/share/wordpress/wp-content/plugins/google-hilite.php 2006-05-26 00:17:32.000000000 +0200
@@ -81,6 +81,10 @@
break;
case 'wordpress':
+ if (preg_match('|^http://'. quotemeta($_SERVER["SERVER_NAME"]) .’|i’, $referer)){
+ return false;
+ break;
+ }
if ( is_search() )
return true;

The Hacking google-highlight plugin by Cyconet Blog, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Terms and conditions beyond the scope of this license may be available at blog.waja.info.

0 Responses to “Hacking google-highlight plugin”
Leave a Reply