From: Alexandre Emsenhuber Date: Fri, 12 Jun 2009 18:31:07 +0000 (+0000) Subject: Kill some E_NOTICE when protecting a non-existing page X-Git-Tag: 1.31.0-rc.0~41404 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=36b535d199ac72ebc401dc937bccbbaa1ed09d7f;p=lhc%2Fweb%2Fwiklou.git Kill some E_NOTICE when protecting a non-existing page --- 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 ); }