Kill some E_NOTICE when protecting a non-existing page
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 12 Jun 2009 18:31:07 +0000 (18:31 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 12 Jun 2009 18:31:07 +0000 (18:31 +0000)
includes/ProtectionForm.php
includes/Title.php

index e4ca0d7..4c68d38 100644 (file)
@@ -258,7 +258,7 @@ class ProtectionForm {
                #  to a semi-protected page.
                global $wgGroupPermissions;
 
-               $edit_restriction = $this->mRestrictions['edit'];
+               $edit_restriction = isset( $this->mRestrictions['edit'] ) ? $this->mRestrictions['edit'] : '';
                $this->mCascade = $wgRequest->getBool( 'mwProtect-cascade' );
                if ($this->mCascade && ($edit_restriction != 'protect') &&
                        !(isset($wgGroupPermissions[$edit_restriction]['protect']) && $wgGroupPermissions[$edit_restriction]['protect'] ) )
index 3c44877..9245752 100644 (file)
@@ -1447,7 +1447,7 @@ class Title {
 
                if( $create_perm ) {
                        $params = array("[create=$create_perm] $expiry_description",'');
-                       $log->addEntry( $this->mRestrictions['create'] ? 'modify' : 'protect', $this, trim( $reason ), $params );
+                       $log->addEntry( ( isset( $this->mRestrictions['create'] ) && $this->mRestrictions['create'] ) ? 'modify' : 'protect', $this, trim( $reason ), $params );
                } else {
                        $log->addEntry( 'unprotect', $this, $reason );
                }