From: <var...@us...> - 2009-06-04 14:51:35
|
Revision: 6895 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6895&view=rev Author: vargenau Date: 2009-06-04 14:51:28 +0000 (Thu, 04 Jun 2009) Log Message: ----------- Test correctly: string may be at start Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-06-04 13:42:06 UTC (rev 6894) +++ trunk/lib/PageList.php 2009-06-04 14:51:28 UTC (rev 6895) @@ -417,7 +417,7 @@ $score = $page_handle->score; elseif (!empty($page_handle['score'])) $score = $page_handle['score']; - if ($search and ($i = strpos(strtolower($c), strtolower($search)))) { + if ($search and ($i = strpos(strtolower($c), strtolower($search))) !== false) { $l = strlen($search); $j = max(0, $i - ($this->bytes / 2)); return HTML::div(array('style' => 'font-size:x-small'), @@ -426,7 +426,7 @@ HTML::span(array("style"=>"background:yellow"),substr($c, $i, $l)), HTML::span(substr($c, $i+$l, ($this->bytes / 2))."..."." ".($score ? sprintf("[%0.1f]",$score):"")))); } else { - if (strpos($c," ")) + if (strpos($c," ") !== false) $c = ""; else $c = sprintf(_("%s not found"), '»'.$search.'«'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |