r46629 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46628‎ | r46629 | r46630 >
Date:01:19, 31 January 2009
Author:brion
Status:deferred
Tags:
Comment:
* (bug 17146) Fix for UTF-8 and short word search for some possible MySQL configs

Language::stripForSearch() was lowercasing input, but producing 'U8' for its unicode and short-word normalizations... but SearchUpdate::doUpdate() was running *that* through an additional strtolower() before actually saving to the database.
It's possible that some folks configurations were applying a case-sensitive search on the search table (?) which would make these not match up when actually searching. Going ahead and producing 'u8' right off will ensure these stay in sync.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -1564,7 +1564,7 @@
15651565 $n = $minLength-1;
15661566 $out = preg_replace(
15671567 "/\b(\w{1,$n})\b/",
1568 - "$1U800",
 1568+ "$1u800",
15691569 $out );
15701570 }
15711571
@@ -1576,7 +1576,7 @@
15771577 // "example.wikipedia.com" and "192.168.83.1" as well.
15781578 $out = preg_replace(
15791579 "/(\w)\.(\w|\*)/u",
1580 - "$1U82e$2",
 1580+ "$1u82e$2",
15811581 $out );
15821582
15831583 wfProfileOut( __METHOD__ );
@@ -1589,7 +1589,7 @@
15901590 * settings or anything else of the sort.
15911591 */
15921592 protected function stripForSearchCallback( $matches ) {
1593 - return 'U8' . bin2hex( $matches[1] );
 1593+ return 'u8' . bin2hex( $matches[1] );
15941594 }
15951595
15961596 /**
Index: trunk/phase3/RELEASE-NOTES
@@ -119,6 +119,7 @@
120120 * Categoryfinder utility class no longer fails on invalid input or gives wrong
121121 results for category names that include pseudo-namespaces
122122 * (bug 17252) Galician numbering format
 123+* (bug 17146) Fix for UTF-8 and short word search for some possible MySQL configs
123124
124125 == API changes in 1.15 ==
125126 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions

Status & tagging log