From 16a34824811a62e4107b0a4bf12b1056e6d9a5ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 8 Jan 2006 03:09:31 +0000 Subject: [PATCH] * Fixed bugs introduced in revision 1.564 by rob ;) - Changed back to using if $x === false, if ($x) is a logic error in this case because PHP thinks (among other things) that (int)0 and (string)0 are false, so a custom signiture that was "0" would fail - $nick was changed to $nickname in 1.564 in most places, but not all, as a result no fancy signiture worked (feature?;) and php vomited E_NOTICE - $name => $username, same thing as above, variable name change where not all of them were changed resulting in E_NOTICE etc. etc. --- includes/Parser.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index a1662389b7..7293e1fb87 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -3211,15 +3211,15 @@ class Parser $nickname = trim( $user->getOption( 'nickname' ) ); $nickname = ( $nickname == '' ? $username : $nickname ); - if( $user->getOption( 'fancysig' ) ) { + if( $user->getOption( 'fancysig' ) !== false ) { # Sig. might contain markup; validate this - if( $this->validateSig( $nickname ) ) { + if( $this->validateSig( $nickname ) !== false ) { # Validated; clean up (if needed) and return it - return( $this->cleanSig( $nick ) ); + return( $this->cleanSig( $nickname ) ); } else { # Failed to validate; fall back to the default $nickname = $username; - wfDebug( "Parser::getUserSig: $name has bad XML tags in signature.\n" ); + wfDebug( "Parser::getUserSig: $username has bad XML tags in signature.\n" ); } } -- 2.20.1