r51796 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51795‎ | r51796 | r51797 >
Date:18:31, 12 June 2009
Author:ialex
Status:ok
Tags:
Comment:
Kill some E_NOTICE when protecting a non-existing page
Modified paths:
  • /trunk/phase3/includes/ProtectionForm.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ProtectionForm.php
@@ -258,7 +258,7 @@
259259 # to a semi-protected page.
260260 global $wgGroupPermissions;
261261
262 - $edit_restriction = $this->mRestrictions['edit'];
 262+ $edit_restriction = isset( $this->mRestrictions['edit'] ) ? $this->mRestrictions['edit'] : '';
263263 $this->mCascade = $wgRequest->getBool( 'mwProtect-cascade' );
264264 if ($this->mCascade && ($edit_restriction != 'protect') &&
265265 !(isset($wgGroupPermissions[$edit_restriction]['protect']) && $wgGroupPermissions[$edit_restriction]['protect'] ) )
Index: trunk/phase3/includes/Title.php
@@ -1447,7 +1447,7 @@
14481448
14491449 if( $create_perm ) {
14501450 $params = array("[create=$create_perm] $expiry_description",'');
1451 - $log->addEntry( $this->mRestrictions['create'] ? 'modify' : 'protect', $this, trim( $reason ), $params );
 1451+ $log->addEntry( ( isset( $this->mRestrictions['create'] ) && $this->mRestrictions['create'] ) ? 'modify' : 'protect', $this, trim( $reason ), $params );
14521452 } else {
14531453 $log->addEntry( 'unprotect', $this, $reason );
14541454 }

Status & tagging log