From: Ævar Arnfjörð Bjarmason Date: Sun, 8 Jan 2006 03:09:31 +0000 (+0000) Subject: * Fixed bugs introduced in revision 1.564 by rob ;) X-Git-Tag: 1.6.0~705 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=16a34824811a62e4107b0a4bf12b1056e6d9a5ac;p=lhc%2Fweb%2Fwiklou.git * 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. --- 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" ); } }