From 0512db6bc31b3e26a50b82a6cf06c300272fc9dc Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Thu, 11 Sep 2008 20:01:39 +0000 Subject: [PATCH] We already have an Article object, so no need to recreate another one. Also removed some PHP4-ism. --- includes/ProtectionForm.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index f6910621e0..222851c190 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -30,11 +30,11 @@ class ProtectionForm { var $mPermErrors = array(); var $mApplicableTypes = array(); - function __construct( &$article ) { + function __construct( Article $article ) { global $wgRequest, $wgUser; global $wgRestrictionTypes, $wgRestrictionLevels; - $this->mArticle =& $article; - $this->mTitle =& $article->mTitle; + $this->mArticle = $article; + $this->mTitle = $article->mTitle; $this->mApplicableTypes = $this->mTitle->exists() ? $wgRestrictionTypes : array('create'); if( $this->mTitle ) { @@ -95,8 +95,7 @@ class ProtectionForm { global $wgRequest, $wgOut; if( $wgRequest->wasPosted() ) { if( $this->save() ) { - $article = new Article( $this->mTitle ); - $q = $article->isRedirect() ? 'redirect=no' : ''; + $q = $this->mArticle->isRedirect() ? 'redirect=no' : ''; $wgOut->redirect( $this->mTitle->getFullUrl( $q ) ); } } else { -- 2.20.1