diff -r efae425e9b98 -r 425261984266 plugins/SpecialSearch.php --- a/plugins/SpecialSearch.php Sun Jul 01 14:51:33 2007 -0400 +++ b/plugins/SpecialSearch.php Sun Jul 01 15:00:32 2007 -0400 @@ -1,11 +1,11 @@ header(); if(!empty($q)) { + // See if any pages directly match the title + + for ( $i = 0; $i < count ( $paths->pages ) / 2; $i++ ) + { + $pg =& $paths->pages[$i]; + $q_lc = strtolower( str_replace(' ', '_', $q) ); + $q_tl = strtolower( str_replace('_', ' ', $q) ); + $p_lc = strtolower($pg['urlname']); + $p_tl = strtolower($pg['name']); + if ( strstr($p_tl, $q_tl) || strstr($p_lc, $q_lc) ) + { + echo '
Perhaps you were looking for ' . htmlspecialchars($pg['name']) . '?
'; + break; + } + } + switch(SEARCH_MODE) { @@ -499,7 +515,7 @@ if ( $num_results < 1 ) { - echo '
No pages that matched your search criteria could be found.
'; + echo '
No page text that matched your search criteria could be found.
'; return null; }