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 |
— | — | @@ -54,7 +54,11 @@ |
55 | 55 | if( !empty( $terms[3] ) ) { |
56 | 56 | // Match individual terms in result highlighting... |
57 | 57 | $regexp = preg_quote( $terms[3], '/' ); |
58 | | - if( $terms[4] ) $regexp .= "[0-9A-Za-z_]+"; |
| 58 | + if( $terms[4] ) { |
| 59 | + $regexp = "\b$regexp"; // foo* |
| 60 | + } else { |
| 61 | + $regexp = "\b$regexp\b"; |
| 62 | + } |
59 | 63 | } else { |
60 | 64 | // Match the quoted term in result highlighting... |
61 | 65 | $regexp = preg_quote( str_replace( '"', '', $terms[2] ), '/' ); |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -1549,6 +1549,17 @@ |
1550 | 1550 | $out ); |
1551 | 1551 | } |
1552 | 1552 | |
| 1553 | + // Periods within things like hostnames and IP addresses |
| 1554 | + // are also important -- we want a search for "example.com" |
| 1555 | + // or "192.168.1.1" to work sanely. |
| 1556 | + // |
| 1557 | + // MySQL's search seems to ignore them, so you'd match on |
| 1558 | + // "example.wikipedia.com" and "192.168.83.1" as well. |
| 1559 | + $out = preg_replace( |
| 1560 | + "/(\w)\.(\w|\*)/u", |
| 1561 | + "$1U82e$2", |
| 1562 | + $out ); |
| 1563 | + |
1553 | 1564 | wfProfileOut( __METHOD__ ); |
1554 | 1565 | return $out; |
1555 | 1566 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -428,6 +428,8 @@ |
429 | 429 | DB environments when $wgDBserver isn't set. |
430 | 430 | * (bug 3691) Aspect ratio from viewBox attribute is now preserved for SVG |
431 | 431 | images which do not specify width and height attributes. |
| 432 | +* (bug 15027) Internet domain names and IP addresses can now be indexed and |
| 433 | + searched sensibly with the default MySQL search backend. |
432 | 434 | |
433 | 435 | === API changes in 1.14 === |
434 | 436 | |