From: Brion Vibber Date: Sun, 14 Dec 2003 05:14:04 +0000 (+0000) Subject: Fix for bug #859195: the string '0' evaluates to false in PHP, even when using the... X-Git-Tag: 1.3.0beta1~1250 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=e70b34444938844231e32015c08f6c19b87ad974;p=lhc%2Fweb%2Fwiklou.git Fix for bug #859195: the string '0' evaluates to false in PHP, even when using the empty() function, which can break links in the form [[foo|0]] such that the pipe text is ignored and the link title shows as the text --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 492733c948..dacae9ab55 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -932,7 +932,7 @@ $t[] = "" ; } if($wgNamespacesWithSubpages[$wgTitle->getNamespace()]) { # subpages allowed here $link = $wgTitle->getPrefixedText(). "/" . trim($noslash); - if(!$text) { + if( "" == $text ) { $text= $m[1]; } # this might be changed for ugliness reasons } else { @@ -943,7 +943,7 @@ $t[] = "" ; } else { $link = substr( $m[1], 1 ); } - if( empty( $text ) ) + if( "" == $text ) $text = $link; $nt = Title::newFromText( $link );