r12493 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12492‎ | r12493 | r12494 >
Date:03:09, 8 January 2006
Author:avar
Status:old
Tags:
Comment:
* 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.
Modified paths:
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -3211,15 +3211,15 @@
32123212 $nickname = trim( $user->getOption( 'nickname' ) );
32133213 $nickname = ( $nickname == '' ? $username : $nickname );
32143214
3215 - if( $user->getOption( 'fancysig' ) ) {
 3215+ if( $user->getOption( 'fancysig' ) !== false ) {
32163216 # Sig. might contain markup; validate this
3217 - if( $this->validateSig( $nickname ) ) {
 3217+ if( $this->validateSig( $nickname ) !== false ) {
32183218 # Validated; clean up (if needed) and return it
3219 - return( $this->cleanSig( $nick ) );
 3219+ return( $this->cleanSig( $nickname ) );
32203220 } else {
32213221 # Failed to validate; fall back to the default
32223222 $nickname = $username;
3223 - wfDebug( "Parser::getUserSig: $name has bad XML tags in signature.\n" );
 3223+ wfDebug( "Parser::getUserSig: $username has bad XML tags in signature.\n" );
32243224 }
32253225 }
32263226

Status & tagging log