r92642 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92641‎ | r92642 | r92643 >
Date:16:49, 20 July 2011
Author:ialex
Status:ok
Tags:
Comment:
Make Title::isNamespaceProtected() require the $user parameter, the only call to it is in the file itself
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -1167,17 +1167,12 @@
11681168 * Determines if $user is unable to edit this page because it has been protected
11691169 * by $wgNamespaceProtection.
11701170 *
1171 - * @param $user User object, $wgUser will be used if not passed
 1171+ * @param $user User object to check permissions
11721172 * @return Bool
11731173 */
1174 - public function isNamespaceProtected( User $user = null ) {
 1174+ public function isNamespaceProtected( User $user ) {
11751175 global $wgNamespaceProtection;
11761176
1177 - if ( $user === null ) {
1178 - global $wgUser;
1179 - $user = $wgUser;
1180 - }
1181 -
11821177 if ( isset( $wgNamespaceProtection[$this->mNamespace] ) ) {
11831178 foreach ( (array)$wgNamespaceProtection[$this->mNamespace] as $right ) {
11841179 if ( $right != '' && !$user->isAllowed( $right ) ) {

Status & tagging log