r110199 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110198‎ | r110199 | r110200 >
Date:00:45, 28 January 2012
Author:yaron
Status:deferred
Tags:
Comment:
Follow-up to r110185 - missed one section of the patch
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_Utils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_Utils.php
@@ -607,12 +607,10 @@
608608 }
609609
610610 $db = wfGetDB( DB_SLAVE );
611 - $conditions = "page_namespace = $matchingNamespaceCode";
 611+ $conditions = array();
 612+ $conditions['page_namespace'] = $matchingNamespaceCode;
612613 if ( $substring != null ) {
613 - $substring = str_replace( ' ', '_', strtolower( $substring ) );
614 - $substring = str_replace( '_', '\_', $substring );
615 - $substring = str_replace( "'", "\'", $substring );
616 - $conditions .= " AND (LOWER(CONVERT(`page_title` USING utf8)) LIKE '$substring%' OR LOWER(CONVERT(`page_title` USING utf8)) LIKE '%\_$substring%')";
 614+ $conditions[] = SFUtils::getSQLConditionForAutocompleteInColumn( 'page_title', $substring );
617615 }
618616 $res = $db->select( 'page',
619617 'page_title',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r110185Added additional handling of $sfgAutocompleteOnAllChars, and streamlined some...yaron23:18, 27 January 2012