* Fixed bugs introduced in revision 1.564 by rob ;)
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sun, 8 Jan 2006 03:09:31 +0000 (03:09 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sun, 8 Jan 2006 03:09:31 +0000 (03:09 +0000)
  - 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

index a166238..7293e1f 100644 (file)
@@ -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" );
                        }
                }