r46190 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46189‎ | r46190 | r46191 >
Date:09:12, 25 January 2009
Author:nikerabbit
Status:resolved (Comments)
Tags:
Comment:
* (bug 17150) escapeLike now escapes literal \ properly
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/db/Database.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/Database.php
@@ -1397,7 +1397,7 @@
13981398 } else {
13991399 $list .= $field." IN (".$this->makeList($value).") ";
14001400 }
1401 - } elseif( is_null($value) ) {
 1401+ } elseif( $value === null ) {
14021402 if ( $mode == LIST_AND || $mode == LIST_OR ) {
14031403 $list .= "$field IS ";
14041404 } elseif ( $mode == LIST_SET ) {
@@ -1605,7 +1605,7 @@
16061606 * Otherwise returns as-is
16071607 */
16081608 function addQuotes( $s ) {
1609 - if ( is_null( $s ) ) {
 1609+ if ( $s === null ) {
16101610 return 'NULL';
16111611 } else {
16121612 # This will also quote numeric values. This should be harmless,
@@ -1621,7 +1621,7 @@
16221622 */
16231623 function escapeLike( $s ) {
16241624 $s=$this->strencode( $s );
1625 - $s=str_replace(array('%','_'),array('\%','\_'),$s);
 1625+ $s=str_replace(array('%','_','\\'),array('\%','\_','\\\\'),$s);
16261626 return $s;
16271627 }
16281628
Index: trunk/phase3/RELEASE-NOTES
@@ -81,6 +81,7 @@
8282 * (bug 10569) redirects to Special:Mypage and Special:Mytalk are no longer
8383 allowed by default. Change $wgInvalidRedirectTargets to re-enable.
8484 * (bug 3043) Feed links of given page are now preceded by standard feed icon
 85+* (bug 17150) escapeLike now escapes literal \ properly
8586
8687 == API changes in 1.15 ==
8788 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions

Comments

#Comment by Nikerabbit (talk | contribs)   21:03, 26 January 2009

This was broken, see r46285.

Status & tagging log