Kill some E_NOTICE when protecting a non-existing page

This commit is contained in:
Alexandre Emsenhuber 2009-06-12 18:31:07 +00:00
parent d20794df5c
commit 36b535d199
2 changed files with 2 additions and 2 deletions

View 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'] ) )

View 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 );
}