From e70b34444938844231e32015c08f6c19b87ad974 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 14 Dec 2003 05:14:04 +0000 Subject: [PATCH] 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 --- includes/OutputPage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ); -- 2.20.1