Index: branches/2.6.x/wb/search/search.php
===================================================================
--- branches/2.6.x/wb/search/search.php	(revision 490)
+++ branches/2.6.x/wb/search/search.php	(revision 491)
@@ -53,13 +53,14 @@
 		} else {
 			$string=$_REQUEST['string'];
 		}
+		$string = $wb->add_slashes($string);
 		// remove some bad chars like _single_ '"', '&'. '!", ...
 		$string = preg_replace("/(^|\s+)([-=+_&!;#]|\\\\\"|\\\\')+(?=\s+|$)/", "", $string);
-		$string = my_htmlspecialchars($string);
+		$string = strtr(my_htmlspecialchars($string), array('\&quot;'=>'&quot;'));
 		// reverse potential magic_quotes action
 		$original_string=$wb->strip_slashes($string);
 		// Double backslashes (mySQL needs doubly escaped backslashes in LIKE comparisons)
-		$string = addslashes($wb->escape_backslashes($original_string));
+		$string = $wb->escape_backslashes($original_string);
 		// convert a copy of $string to HTML-ENTITIES
 		$string_entities = umlauts_to_entities($string);
 		// and do some convertion to both
Index: branches/2.6.x/wb/search/search_convert.php
===================================================================
--- branches/2.6.x/wb/search/search_convert.php	(revision 490)
+++ branches/2.6.x/wb/search/search_convert.php	(revision 491)
@@ -1,6 +1,6 @@
 <?php
 
-// $Id: search_convert.php 480 2007-06-11 16:35:58Z Ruebenwurzel $
+// $Id: search_convert.php 490 2007-06-23 08:13:53Z Ruebenwurzel $
 
 /*
 
@@ -35,11 +35,11 @@
 
 //htmlspecialchars_decode
 $string_htmlspecialchars_decode=array(
-	"&lt;"=>"<", "&gt;"=>">", "&amp;"=>"&", "&quot;"=>"\"", "&#039;"=>"\'"
+	"&lt;"=>"<", "&gt;"=>">", "&amp;"=>"&", "&quot;"=>"\"", "&#39;"=>"\'"
 );
 //htmlspecialchars_decode
 $string_htmlspecialchars_encode=array(
-	"<"=>"&lt;", ">"=>"&gt;", "&"=>"&amp;", "\""=>"&quot;", "\'"=>"&#039;"
+	"<"=>"&lt;", ">"=>"&gt;", "&"=>"&amp;", "\""=>"&quot;", "\'"=>"&#39;"
 );
 
 //convert some bad characters
Index: branches/2.6.x/wb/framework/convert.php
===================================================================
--- branches/2.6.x/wb/framework/convert.php	(revision 490)
+++ branches/2.6.x/wb/framework/convert.php	(revision 491)
@@ -50,7 +50,7 @@
 '&#154;'=>'s',
 '&#159;'=>'Y',
 '&copy;'=>'(c)','&reg;'=>'(r)','&ETH;'=>'D','&times;'=>'x','&Oslash;'=>'O','&THORN;'=>'TH','&eth;'=>'d','&oslash;'=>'o','&thorn;'=>'th',
-'&#039;'=>'-','&quot;'=>'-',
+'&#39;'=>'-','&apos;'=>'-','&quot;'=>'-',
 // latin extended-A
 '&#256;'=>'A','&#257;'=>'a','&#258;'=>'A','&#259;'=>'a','&#260;'=>'A','&#261;'=>'a',
 '&#262;'=>'C','&#263;'=>'c','&#264;'=>'C','&#265;'=>'c','&#269;'=>'c','&#268;'=>'C','&#267;'=>'c','&#266;'=>'C',
Index: branches/2.6.x/wb/framework/frontend.functions.php
===================================================================
--- branches/2.6.x/wb/framework/frontend.functions.php	(revision 490)
+++ branches/2.6.x/wb/framework/frontend.functions.php	(revision 491)
@@ -76,14 +76,14 @@
 	$string = entities_to_umlauts($search_string, 'UTF-8');
 	$string = strtr($string, $string_ul_umlauts);
 	// do some magic to prevent &lt; &gt; ... from being highlighted
-	$foo = strtr($foo, array("&lt;"=>"!,,!", "&gt;"=>"!,,,!", "&amp;"=>"!,,,,!", "&quot;"=>"!,,,,,!", "&#039;"=>"!,,,,,,!"));
-	$string = strtr($string, array("&lt;"=>"!,,!", "&gt;"=>"!,,,!", "&amp;"=>"!,,,,!", "&quot;"=>"!,,,,,!", "&#039;"=>"!,,,,,,!"));
+	$foo = strtr($foo, array("&lt;"=>"!,,!", "&gt;"=>"!,,,!", "&amp;"=>"!,,,,!", "&quot;"=>"!,,,,,!", "&#39;"=>"!,,,,,,!"));
+	$string = strtr($string, array("&lt;"=>"!,,!", "&gt;"=>"!,,,!", "&amp;"=>"!,,,,!", "&quot;"=>"!,,,,,!", "&#39;"=>"!,,,,,,!"));
 	$foo = preg_replace('/('.$string.')(?=[^>]*<)/iUS', '<span class="highlight">$1</span>',$foo);
 	$pos = strpos($foo, '<');
 	if ($pos === false) { // "===" means identicaly
 		$foo = preg_replace('/('.$string.')/i', '<span class="highlight">$1</span>',$foo);
 	}
-	$foo = strtr($foo, array("!,,!"=>"&lt;", "!,,,!"=>"&gt;", "!,,,,!"=>"&amp;", "!,,,,,!"=>"&quot;", "!,,,,,,!"=>"&#039;"));
+	$foo = strtr($foo, array("!,,!"=>"&lt;", "!,,,!"=>"&gt;", "!,,,,!"=>"&amp;", "!,,,,,!"=>"&quot;", "!,,,,,,!"=>"&#39;"));
 	if(DEFAULT_CHARSET != 'utf-8') {
 		$foo = umlauts_to_defcharset($foo, 'UTF-8');
 	}
Index: branches/2.6.x/wb/framework/functions.php
===================================================================
--- branches/2.6.x/wb/framework/functions.php	(revision 490)
+++ branches/2.6.x/wb/framework/functions.php	(revision 491)
@@ -341,7 +341,7 @@
 // Function as replecement for php's htmlspecialchars()
 function my_htmlspecialchars($string) {
 	$string = preg_replace("/&(?=[#a-z0-9]+;)/i", "_x_", $string);
-	$string = strtr($string, array("<"=>"&lt;", ">"=>"&gt;", "&"=>"&amp;", "\""=>"&quot;", "\'"=>"&#039;"));
+	$string = strtr($string, array("<"=>"&lt;", ">"=>"&gt;", "&"=>"&amp;", "\""=>"&quot;", "\'"=>"&#39;"));
 	$string = preg_replace("/_x_(?=[#a-z0-9]+;)/i", "&", $string);
 	return($string);
 }
@@ -431,9 +431,9 @@
 				}
 			}
 		} else {
-			$string = strtr($string, array("&lt;"=>"&_lt;", "&gt;"=>"&_gt;", "&amp;"=>"&_amp;", "&quot;"=>"&_quot;", "&#039;"=>"&_#039;"));
+			$string = strtr($string, array("&lt;"=>"&_lt;", "&gt;"=>"&_gt;", "&amp;"=>"&_amp;", "&quot;"=>"&_quot;", "&#39;"=>"&_#39;"));
 			$string=mb_convert_encoding($string, $charset_out, $charset_in);
-			$string = strtr($string, array("&_lt;"=>"&lt;", "&_gt;"=>"&gt;", "&_amp;"=>"&amp;", "&_quot;"=>"&quot;", "&_#039;"=>"&#039;"));
+			$string = strtr($string, array("&_lt;"=>"&lt;", "&_gt;"=>"&gt;", "&_amp;"=>"&amp;", "&_quot;"=>"&quot;", "&_#39;"=>"&#39;"));
 		}
 		return $string;
 	}
@@ -613,6 +613,7 @@
 	);
 		
 	if ($in == 'HTML-ENTITIES') {
+		$string = strtr($string, array('&#039;'=>'&#39;')); // fix a broken entity
 		$string = strtr($string, $named_to_numbered_entities);
 		$string = preg_replace("/&#([0-9]+);/e", "code_to_utf8($1)", $string);
 	}
