includes/search.php
changeset 1289 541bb25d0b22
parent 1228 9e9334417dbc
child 1367 c660cf54c045
--- a/includes/search.php	Tue Aug 03 22:10:07 2010 -0400
+++ b/includes/search.php	Sun Aug 08 17:18:00 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 )
 	{