* (bug 17150) escapeLike now escapes literal \ properly
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Sun, 25 Jan 2009 09:12:41 +0000 (09:12 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Sun, 25 Jan 2009 09:12:41 +0000 (09:12 +0000)
RELEASE-NOTES
includes/db/Database.php

index 24c52b4..6153ba1 100644 (file)
@@ -81,6 +81,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 10569) redirects to Special:Mypage and Special:Mytalk are no longer
   allowed by default. Change $wgInvalidRedirectTargets to re-enable.
 * (bug 3043) Feed links of given page are now preceded by standard feed icon
+* (bug 17150) escapeLike now escapes literal \ properly
 
 == API changes in 1.15 ==
 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions
index b86f35d..586baee 100644 (file)
@@ -1397,7 +1397,7 @@ class Database {
                                } else {
                                        $list .= $field." IN (".$this->makeList($value).") ";
                                }
-                       } elseif( is_null($value) ) {
+                       } elseif( $value === null ) {
                                if ( $mode == LIST_AND || $mode == LIST_OR ) {
                                        $list .= "$field IS ";
                                } elseif ( $mode == LIST_SET ) {
@@ -1605,7 +1605,7 @@ class Database {
         * Otherwise returns as-is
         */
        function addQuotes( $s ) {
-               if ( is_null( $s ) ) {
+               if ( $s === null ) {
                        return 'NULL';
                } else {
                        # This will also quote numeric values. This should be harmless,
@@ -1621,7 +1621,7 @@ class Database {
         */
        function escapeLike( $s ) {
                $s=$this->strencode( $s );
-               $s=str_replace(array('%','_'),array('\%','\_'),$s);
+               $s=str_replace(array('%','_','\\'),array('\%','\_','\\\\'),$s);
                return $s;
        }