includes/search.php
changeset 1301 bd9e124f5904
parent 1289 541bb25d0b22
child 1367 c660cf54c045
--- a/includes/search.php	Sun Sep 05 16:05:06 2010 -0400
+++ b/includes/search.php	Sun Sep 05 16:05:33 2010 -0400
@@ -549,7 +549,8 @@
 
 	// Divisor for calculating relevance scores
 	$divisor = ( count($query['any']) + count($query_phrase['any']) + count($query['req']) + count($query['not']) ) * 1.5;
-	$divisor = max($divisor, max($scores));
+	$divisor = max($divisor,
+				count($scores) > 0 ? max($scores) : 0);
 	
 	foreach ( $scores as $page_id => $score )
 	{