# HG changeset patch # User Dan # Date 1191717864 14400 # Node ID 01bf6b1b8222fee5174f73bad72084560da23f4d # Parent bee40e39321b09f0c38f578c322b34dd68b664c4 "Perhaps you were looking for" box now only shows if strlen($q) >= 4 diff -r bee40e39321b -r 01bf6b1b8222 plugins/SpecialSearch.php --- a/plugins/SpecialSearch.php Sat Oct 06 20:39:18 2007 -0400 +++ b/plugins/SpecialSearch.php Sat Oct 06 20:44:24 2007 -0400 @@ -100,18 +100,21 @@ if(!empty($q)) { // See if any pages directly match the title - - for ( $i = 0; $i < count ( $paths->pages ) / 2; $i++ ) + + if ( strlen($q) >= 4 ) { - $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) && $pg['visible'] == 1 ) + for ( $i = 0; $i < count ( $paths->pages ) / 2; $i++ ) { - echo '
'; - break; + $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) && $pg['visible'] == 1 ) + { + echo ' '; + break; + } } }