Index: trunk/extensions/SemanticForms/includes/SF_Utils.php |
— | — | @@ -607,12 +607,10 @@ |
608 | 608 | } |
609 | 609 | |
610 | 610 | $db = wfGetDB( DB_SLAVE ); |
611 | | - $conditions = "page_namespace = $matchingNamespaceCode"; |
| 611 | + $conditions = array(); |
| 612 | + $conditions['page_namespace'] = $matchingNamespaceCode; |
612 | 613 | 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 ); |
617 | 615 | } |
618 | 616 | $res = $db->select( 'page', |
619 | 617 | 'page_title', |