r70193 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70192‎ | r70193 | r70194 >
Date:17:22, 30 July 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Replaced three last instances of escapeLike with buildLike in Translate extension
Modified paths:
  • /trunk/extensions/Translate/SpecialTranslations.php (modified) (history)
  • /trunk/extensions/Translate/scripts/fuzzy.php (modified) (history)
  • /trunk/extensions/Translate/utils/MessageWebImporter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/fuzzy.php
@@ -101,7 +101,7 @@
102102 foreach ( $this->titles as $title ) {
103103 $title = TranslateUtils::title( $title, '' );
104104 $title = str_replace( ' ', '_', $title );
105 - $search_titles[] = "page_title LIKE '{$dbr->escapeLike( $title )}%%'";
 105+ $search_titles[] = 'page_title ' . $dbr->buildLike( $title, $dbr->anyString() );
106106 }
107107
108108 $condArray = array(
Index: trunk/extensions/Translate/utils/MessageWebImporter.php
@@ -345,13 +345,11 @@
346346 // Work on all subpages of base title.
347347 $titleText = $title->getBaseText();
348348
349 - $namespace = $title->getNamespace();
350 - $titleText = $dbw->escapeLike( $titleText );
351349 $conds = array(
352 - 'page_namespace' => $namespace,
 350+ 'page_namespace' => $title->getNamespace(),
353351 'page_latest=rev_id',
354352 'rev_text_id=old_id',
355 - 'page_title LIKE \'' . $titleText . '\/%\''
 353+ 'page_title ' . $dbw->buildLike( "$titleText/", $dbw->anyString() ),
356354 );
357355
358356 $rows = $dbw->select(
Index: trunk/extensions/Translate/SpecialTranslations.php
@@ -127,7 +127,7 @@
128128 array( 'page_namespace', 'page_title' ),
129129 array(
130130 'page_namespace' => $namespace,
131 - 'page_title LIKE \'' . $dbr->escapeLike( $message ) . '\/%\'',
 131+ 'page_title ' . $dbr->buildLike( "$message/", $dbr->anyString() ),
132132 ),
133133 __METHOD__,
134134 array(

Status & tagging log