Index: trunk/phase3/includes/SearchEngine.php |
— | — | @@ -150,7 +150,7 @@ |
151 | 151 | } |
152 | 152 | |
153 | 153 | public static function legalSearchChars() { |
154 | | - return "A-Za-z_'0-9\\x80-\\xFF\\-\\?"; |
| 154 | + return "A-Za-z_'0-9\\x80-\\xFF\\-"; |
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
Index: trunk/phase3/includes/SearchMySQL.php |
— | — | @@ -43,18 +43,12 @@ |
44 | 44 | |
45 | 45 | # FIXME: This doesn't handle parenthetical expressions. |
46 | 46 | $m = array(); |
47 | | - if( preg_match_all( '/([-+<>?~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/', |
48 | | - $filteredText, $m, PREG_SET_ORDER ) ) |
49 | | - { |
| 47 | + if( preg_match_all( '/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/', |
| 48 | + $filteredText, $m, PREG_SET_ORDER ) ) { |
50 | 49 | foreach( $m as $terms ) { |
51 | 50 | if( $searchon !== '' ) $searchon .= ' '; |
52 | | - if( $this->strictMatching ) { |
53 | | - // '' means AND while ? means OR to the user |
54 | | - if( $terms[1] == '' ) { |
55 | | - $terms[1] = '+'; |
56 | | - } else if( $terms[1] == '?' ) { |
57 | | - $terms[1] = ''; |
58 | | - } |
| 51 | + if( $this->strictMatching && ($terms[1] == '') ) { |
| 52 | + $terms[1] = '+'; |
59 | 53 | } |
60 | 54 | $searchon .= $terms[1] . $wgContLang->stripForSearch( $terms[2] ); |
61 | 55 | if( !empty( $terms[3] ) ) { |