Index: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG	(revision 847)
+++ trunk/CHANGELOG	(revision 848)
@@ -10,7 +10,10 @@
 # = Bugfix
 ! = Update/Change
 
-------------------------------------- 2.7.1 -------------------------------------
+------------------------------------- 2.7.1 -------------------------------------
+22-Jun-2008 Thomas Hornik
+# fixed issue with captcha (mt_rand() instead of rand())
+# fixed bug in search (link to http://.../search/index.php performs a search with string 'unset')
 22-June-2008 Christian Sommer
 !	added output of block number to section admin if no block name is specified
 21-June-2008 Christian Sommer
Index: trunk/wb/include/captcha/captchas/ttf_image.php
===================================================================
--- trunk/wb/include/captcha/captchas/ttf_image.php	(revision 847)
+++ trunk/wb/include/captcha/captchas/ttf_image.php	(revision 848)
@@ -43,12 +43,12 @@
 if(!function_exists('randomString')) {
 	function randomString($len) {
 		list($usec, $sec) = explode(' ', microtime());
-		srand((float)$sec + ((float)$usec * 100000));
+		mt_srand((float)$sec + ((float)$usec * 100000));
 		//$possible="ABCDEFGHJKLMNPRSTUVWXYZabcdefghkmnpqrstuvwxyz23456789";
 		$possible="abdfhkrsvwxz23456789";
 		$str="";
 		while(strlen($str)<$len) {
-			$str.=substr($possible,(rand()%(strlen($possible))),1);
+			$str.=substr($possible,(mt_rand()%(strlen($possible))),1);
 		}
 		return($str);
 	}
@@ -64,25 +64,25 @@
 
 // create image
 $image = ImageCreateFromPNG($bg); // background image
-$grey = rand(0,50);
+$grey = mt_rand(0,50);
 $color = ImageColorAllocate($image, $grey, $grey, $grey); // font-color
 $ttf = $font;
 $ttfsize = 25; // fontsize
 
-if(rand(0,2)==0) { // 1 out of 3
+if(mt_rand(0,2)==0) { // 1 out of 3
 
 	// draw each character individualy
 	$count = 0;
 	$image_failed = true;
-	$angle = rand(-15,15);
-	$x = rand(10,25);
-	$y = rand($height-10,$height-2);
+	$angle = mt_rand(-15,15);
+	$x = mt_rand(10,25);
+	$y = mt_rand($height-10,$height-2);
 	do {
 		for($i=0;$i<strlen($text);$i++) {
 			$res = imagettftext($image, $ttfsize, $angle, $x, $y, $color, $ttf, $text{$i});
-			$angle = rand(-15,15);
-			$x = rand($res[4],$res[4]+10);
-			$y = rand($height-15,$height-5);
+			$angle = mt_rand(-15,15);
+			$x = mt_rand($res[4],$res[4]+10);
+			$y = mt_rand($height-15,$height-5);
 		}
 		if($res[4] > $width) {
 			$image_failed = true;
@@ -100,13 +100,13 @@
 	$count=0;
 	do {
 		$image = ImageCreateFromPNG($bg); // background image
-		$grey = rand(0,50);
+		$grey = mt_rand(0,50);
 		$color = ImageColorAllocate($image, $grey, $grey, $grey); // font-color
 		$ttf = $font;
 		$ttfsize = 25; // fontsize
-		$angle = rand(0,5);
-		$x = rand(5,30);
-		$y = rand($height-10,$height-2);
+		$angle = mt_rand(0,5);
+		$x = mt_rand(5,30);
+		$y = mt_rand($height-10,$height-2);
 		$res = imagettftext($image, $ttfsize, $angle, $x, $y, $color, $ttf, $text);
 		// check if text fits into the image
 		if(($res[0]>0 && $res[0]<$width) && ($res[1]>0 && $res[1]<$height) && 
Index: trunk/wb/include/captcha/captchas/calc_ttf_image.php
===================================================================
--- trunk/wb/include/captcha/captchas/calc_ttf_image.php	(revision 847)
+++ trunk/wb/include/captcha/captchas/calc_ttf_image.php	(revision 848)
@@ -73,25 +73,25 @@
 
 // create image
 $image = ImageCreateFromPNG($bg); // background image
-$grey = rand(0,50);
+$grey = mt_rand(0,50);
 $color = ImageColorAllocate($image, $grey, $grey, $grey); // font-color
 $ttf = $font;
 $ttfsize = 25; // fontsize
 
-if(rand(0,2)==0) { // 1 out of 3
+if(mt_rand(0,2)==0) { // 1 out of 3
 
 	// draw each character individualy
 	$count = 0;
 	$image_failed = true;
-	$angle = rand(-10,10);
-	$x = rand(20,35);
-	$y = rand($height-10,$height-2);
+	$angle = mt_rand(-10,10);
+	$x = mt_rand(20,35);
+	$y = mt_rand($height-10,$height-2);
 	do {
 		for($i=0;$i<strlen($text);$i++) {
 			$res = imagettftext($image, $ttfsize, $angle, $x, $y, $color, $ttf, $text{$i});
-			$angle = rand(-10,10);
-			$x = rand($res[4],$res[4]+10);
-			$y = rand($height-12,$height-7);
+			$angle = mt_rand(-10,10);
+			$x = mt_rand($res[4],$res[4]+10);
+			$y = mt_rand($height-12,$height-7);
 		}
 		if($res[4] > $width) {
 			$image_failed = true;
@@ -109,11 +109,11 @@
 	$count=0;
 	do {
 		$image = ImageCreateFromPNG($bg); // background image
-		$grey = rand(0,50);
+		$grey = mt_rand(0,50);
 		$color = ImageColorAllocate($image, $grey, $grey, $grey); // font-color
-		$angle = rand(0,5);
-		$x = rand(20,35);
-		$y = rand($height-10,$height-2);
+		$angle = mt_rand(0,5);
+		$x = mt_rand(20,35);
+		$y = mt_rand($height-10,$height-2);
 		$res = imagettftext($image, $ttfsize, $angle, $x, $y, $color, $ttf, $text);
 		// check if text fits into the image
 		if(($res[0]>0 && $res[0]<$width) && ($res[1]>0 && $res[1]<$height) && 
Index: trunk/wb/include/captcha/captchas/calc_image.php
===================================================================
--- trunk/wb/include/captcha/captchas/calc_image.php	(revision 847)
+++ trunk/wb/include/captcha/captchas/calc_image.php	(revision 848)
@@ -61,13 +61,11 @@
 $gray = imagecolorallocate($image, 0xC0, 0xC0, 0xC0);
 $darkgray = imagecolorallocate($image, 0x30, 0x30, 0x30);
 
-srand((double)microtime()*1000000);
-
 for($i = 0; $i < 30; $i++) {
-	$x1 = rand(0,100);
-	$y1 = rand(0,30);
-	$x2 = rand(0,100);
-	$y2 = rand(0,30);
+	$x1 = mt_rand(0,100);
+	$y1 = mt_rand(0,30);
+	$x2 = mt_rand(0,100);
+	$y2 = mt_rand(0,30);
 	imageline($image, $x1, $y1, $x2, $y2 , $gray);  
 }
 
@@ -74,9 +72,9 @@
 $x = 0;
 $l = strlen($cap);
 for($i = 0; $i < $l; $i++) {
-	$fnt = rand(3,5);
-	$x = $x + rand(12 , 20);
-	$y = rand(7 , 12); 
+	$fnt = mt_rand(3,5);
+	$x = $x + mt_rand(12 , 20);
+	$y = mt_rand(7 , 12); 
 	imagestring($image, $fnt, $x, $y, substr($cap, $i, 1), $darkgray); 
 }
 
Index: trunk/wb/search/search.php
===================================================================
--- trunk/wb/search/search.php	(revision 847)
+++ trunk/wb/search/search.php	(revision 848)
@@ -164,8 +164,8 @@
 }
 
 // Get search string
-$search_normal_string = 'unset';
-$search_entities_string = 'unset'; // for SQL's LIKE
+$search_normal_string = '';
+$search_entities_string = ''; // for SQL's LIKE
 $search_display_string = ''; // for displaying
 $search_url_string = ''; // for $_GET
 $string = '';
