r59798 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59797‎ | r59798 | r59799 >
Date:19:55, 7 December 2009
Author:ialex
Status:deferred (Comments)
Tags:
Comment:
User::newFromName() can now return an instance of WikiError
Modified paths:
  • /trunk/extensions/PasswordReset/PasswordReset_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PasswordReset/PasswordReset_body.php
@@ -174,7 +174,7 @@
175175 if ( $name <> '' ) {
176176
177177 $u = User::newFromName( $name );
178 - if( is_null( $u ) ) {
 178+ if( !$u instanceof User ) {
179179 return true;
180180 } elseif ( 0 == $u->getID() ) {
181181 return true;

Comments

#Comment by Tim Starling (talk | contribs)   00:43, 9 December 2009

Oh right, WikiError, I guess that rules out is_object() then. But WikiError::isError() would work well, that's what it's for after all. In any case I think I'll have to have a close look at any interface that uses WikiError, it's not the nicest programming pattern and can lead to XSS vulnerabilities due to the lack of error formatting. I wrote Status.php partly to address its shortcomings.

Status & tagging log