r415 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r414‎ | r415 | r416 >
Date:18:14, 22 May 2002
Author:vibber
Status:old
Tags:
Comment:
Check non-ascii chars
Modified paths:
  • /trunk/phpwiki/fpw/special_dosearch.php (modified) (history)

Diff [purge]

Index: trunk/phpwiki/fpw/special_dosearch.php
@@ -50,7 +50,7 @@
5151 $res = "" ;
5252 } else {
5353 $oldpos = $pos;
54 - while ( preg_match ( "/\w/", $search{$pos} ) ) $pos++ ;
 54+ while ( preg_match ( "/[\\w\\x80-\\xff]/", $search{$pos} ) ) $pos++ ;
5555 $word = substr ( $search, $oldpos, $pos - $oldpos );
5656 if ( preg_match( "/^".$not."$/i", $word ) ) {
5757 $pos = $oldpos;
@@ -148,7 +148,7 @@
149149 $res = " [-)] $res2" ;
150150 } else {
151151 $oldpos = $pos;
152 - while ( preg_match ( "/\w/", $search{$pos} ) ) $pos++ ;
 152+ while ( preg_match ( "/[\\w\\x80-\\xff]/", $search{$pos} ) ) $pos++ ;
153153 $word = substr ( $search, $oldpos, $pos - $oldpos );
154154 if ( preg_match( "/^".$not."$/i", $word ) ) {
155155 $res2 = srchStrParse ( 3 ) ; # we presume the not is redundant
@@ -183,7 +183,7 @@
184184 $res = "";
185185 } else {
186186 $oldpos = $pos;
187 - while ( preg_match ( "/\w/", $search{$pos} ) ) $pos++ ;
 187+ while ( preg_match ( "/[\\w\\x80-\\xff]/", $search{$pos} ) ) $pos++ ;
188188 $word = substr ( $search, $oldpos, $pos - $oldpos );
189189 if ( preg_match( "/^".$not."$/i", $word ) ) {
190190 $pos = $oldpos ;
@@ -289,7 +289,7 @@
290290 $s .= "\n\n" . $wikiSearchHelp ;
291291 }
292292 else {
293 - preg_match_all ( "/\"(\w+)\"/", $parsedCond, $matches ) ;
 293+ preg_match_all ( "/\"([\\w\\x80-\\xff]+)\"/", $parsedCond, $matches ) ;
294294 $words = $matches[1] ; # determine the search words (positive & negative)
295295
296296 $fallbackSearch = 0 ;

Status & tagging log