Merge "Travis CI: Drop 5.3 as a build target"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 20 Jun 2014 00:20:10 +0000 (00:20 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 20 Jun 2014 00:20:10 +0000 (00:20 +0000)
includes/api/ApiExpandTemplates.php
includes/db/Database.php

index eb3f87c..82d303f 100644 (file)
@@ -89,6 +89,7 @@ class ApiExpandTemplates extends ApiBase {
                // if they didn't want any output except (probably) the parse tree,
                // then don't bother actually fully expanding it
                if ( $prop || $params['prop'] === null ) {
+                       $wgParser->startExternalParse( $title_obj, $options, OT_PREPROCESS );
                        $frame = $wgParser->getPreprocessor()->newFrame();
                        $wikitext = $wgParser->preprocess( $params['text'], $title_obj, $options, null, $frame );
                        if ( $params['prop'] === null ) {
index 16e1ef2..7bbcc2f 100644 (file)
@@ -2539,11 +2539,7 @@ abstract class DatabaseBase implements IDatabase, DatabaseType {
         * @return string
         */
        protected function escapeLikeInternal( $s ) {
-               $s = str_replace( '\\', '\\\\', $s );
-               $s = $this->strencode( $s );
-               $s = str_replace( array( '%', '_' ), array( '\%', '\_' ), $s );
-
-               return $s;
+               return addcslashes( $s, '\%_' );
        }
 
        /**
@@ -2579,7 +2575,7 @@ abstract class DatabaseBase implements IDatabase, DatabaseType {
                        }
                }
 
-               return " LIKE '" . $s . "' ";
+               return " LIKE {$this->addQuotes( $s )} ";
        }
 
        /**