From: Alex Z Date: Thu, 17 Sep 2009 04:27:02 +0000 (+0000) Subject: Fix logic error from r54153. By negating each individual isAllowed check, the OR... X-Git-Tag: 1.31.0-rc.0~39689 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=ebb11757633644a57e7168f24b541fe87e38af0f;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/includes/Title.php b/includes/Title.php index adab8d4ace..b96011b375 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1290,12 +1290,12 @@ class Title { # XXX: Find a way to work around the php bug that prevents using $this->userCanEditCssSubpage() # and $this->userCanEditJsSubpage() from working # XXX: right 'editusercssjs' is deprecated, for backward compatibility only - if( $this->isCssSubpage() && ( !$user->isAllowed('editusercssjs') || !$user->isAllowed('editusercss') ) + if( $this->isCssSubpage() && !( $user->isAllowed('editusercssjs') || $user->isAllowed('editusercss') ) && $action != 'patrol' && !preg_match('/^'.preg_quote($user->getName(), '/').'\//', $this->mTextform) ) { $errors[] = array('customcssjsprotected'); - } else if( $this->isJsSubpage() && ( !$user->isAllowed('editusercssjs') || !$user->isAllowed('edituserjs') ) + } else if( $this->isJsSubpage() && !( $user->isAllowed('editusercssjs') || $user->isAllowed('edituserjs') ) && $action != 'patrol' && !preg_match('/^'.preg_quote($user->getName(), '/').'\//', $this->mTextform) ) {