Revision: 46190
Author:   nikerabbit
Date:     2009-01-25 09:12:41 +0000 (Sun, 25 Jan 2009)

Log Message:
-----------
* (bug 17150) escapeLike now escapes literal \ properly

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES
    trunk/phase3/includes/db/Database.php

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES  2009-01-25 06:52:05 UTC (rev 46189)
+++ trunk/phase3/RELEASE-NOTES  2009-01-25 09:12:41 UTC (rev 46190)
@@ -81,6 +81,7 @@
 * (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

Modified: trunk/phase3/includes/db/Database.php
===================================================================
--- trunk/phase3/includes/db/Database.php       2009-01-25 06:52:05 UTC (rev 
46189)
+++ trunk/phase3/includes/db/Database.php       2009-01-25 09:12:41 UTC (rev 
46190)
@@ -1397,7 +1397,7 @@
                                } 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 @@
         * 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 @@
         */
        function escapeLike( $s ) {
                $s=$this->strencode( $s );
-               $s=str_replace(array('%','_'),array('\%','\_'),$s);
+               $s=str_replace(array('%','_','\\'),array('\%','\_','\\\\'),$s);
                return $s;
        }
 



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to