From 36b535d199ac72ebc401dc937bccbbaa1ed09d7f Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 12 Jun 2009 18:31:07 +0000 Subject: [PATCH] Kill some E_NOTICE when protecting a non-existing page --- includes/ProtectionForm.php | 2 +- includes/Title.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index e4ca0d7afe..4c68d3877e 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -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'] ) ) diff --git a/includes/Title.php b/includes/Title.php index 3c44877247..9245752203 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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 ); } -- 2.20.1