r56492 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56491‎ | r56492 | r56493 >
Date:04:27, 17 September 2009
Author:mrzman
Status:ok
Tags:
Comment:
Fix logic error from r54153. By negating each individual isAllowed check, the OR statement would return true
(and not allow the action) if the user didn't have both rights rather than checking if he has either one.
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -1290,12 +1290,12 @@
12911291 # XXX: Find a way to work around the php bug that prevents using $this->userCanEditCssSubpage()
12921292 # and $this->userCanEditJsSubpage() from working
12931293 # XXX: right 'editusercssjs' is deprecated, for backward compatibility only
1294 - if( $this->isCssSubpage() && ( !$user->isAllowed('editusercssjs') || !$user->isAllowed('editusercss') )
 1294+ if( $this->isCssSubpage() && !( $user->isAllowed('editusercssjs') || $user->isAllowed('editusercss') )
12951295 && $action != 'patrol'
12961296 && !preg_match('/^'.preg_quote($user->getName(), '/').'\//', $this->mTextform) )
12971297 {
12981298 $errors[] = array('customcssjsprotected');
1299 - } else if( $this->isJsSubpage() && ( !$user->isAllowed('editusercssjs') || !$user->isAllowed('edituserjs') )
 1299+ } else if( $this->isJsSubpage() && !( $user->isAllowed('editusercssjs') || $user->isAllowed('edituserjs') )
13001300 && $action != 'patrol'
13011301 && !preg_match('/^'.preg_quote($user->getName(), '/').'\//', $this->mTextform) )
13021302 {

Follow-up revisions

RevisionCommit summaryAuthorDate
r56521wmf-deployment: Merge r56492 (fix usercss/js logic)catrope15:11, 17 September 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r54153* (bug 12110) Split the rights for editing users' CSS/JS subpage from "editus...shinjiman16:44, 1 August 2009

Status & tagging log