From: Alexandre Emsenhuber Date: Thu, 11 Sep 2008 20:01:39 +0000 (+0000) Subject: We already have an Article object, so no need to recreate another one. X-Git-Tag: 1.31.0-rc.0~45362 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=0512db6bc31b3e26a50b82a6cf06c300272fc9dc;p=lhc%2Fweb%2Fwiklou.git We already have an Article object, so no need to recreate another one. Also removed some PHP4-ism. --- 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 {