Use the same object when checking if the user is blocked instead of creating a new...
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Tue, 17 Apr 2012 07:48:58 +0000 (09:48 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Tue, 17 Apr 2012 07:48:58 +0000 (09:48 +0200)
commit89df167b208ccffed90018934388240b5f2ab63f
treeb4756c1c65bd5286f6d452bc81c2a73c303ea9f4
parent7f7649566cc9d2a149f5fffe305ed96a5f07bfa4
Use the same object when checking if the user is blocked instead of creating a new one.

* Block::parseTarget() first called trim() on its parameter which was converting objects into string, thus making the checks for object and null useless; now trim() is called after these checks.
* User::getBlockedStatus() was passing $this->getName() to Block::newFromTargert() which in turn was passed to Block::parseTarget() where a new User object was created.
  Instead of this, the User object is directly passed to Block::newFromTargert(), which avoids creating a new object for the same user.

Change-Id: Iffea21d4f53e8692072749264f7486c22b6be5fd
includes/Block.php
includes/User.php