Fix logic error from r54153. By negating each individual isAllowed check, the OR...
authorAlex Z <mrzman@users.mediawiki.org>
Thu, 17 Sep 2009 04:27:02 +0000 (04:27 +0000)
committerAlex Z <mrzman@users.mediawiki.org>
Thu, 17 Sep 2009 04:27:02 +0000 (04:27 +0000)
(and not allow the action) if the user didn't have both rights rather than checking if he has either one.

includes/Title.php

index adab8d4..b96011b 100644 (file)
@@ -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) )
                {