From: Brion Vibber Date: Fri, 21 Aug 2009 21:51:29 +0000 (+0000) Subject: Cleaning up some old PHP 4 object-reference usage in some edit filtering hooks. X-Git-Tag: 1.31.0-rc.0~40145 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=aa1740d88db989d68df5be4080a7eefc95b6715f;p=lhc%2Fweb%2Fwiklou.git Cleaning up some old PHP 4 object-reference usage in some edit filtering hooks. There was a mix of uses of the reference and non-uses of the reference. :) Reverts r53714 and fixes it from the other end by cleaning up the uses to not expect references. --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 0b64a3c639..e501533e4a 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -282,7 +282,7 @@ fail, returning an error message or an tag if $resultArr was filled. $EditPage : the EditPage object $text : the new text of the article (has yet to be saved) -$resultArr : data in this array will be added to the API result +&$resultArr : data in this array will be added to the API result 'APIGetAllowedParams': use this hook to modify a module's parameters. &$module: Module object @@ -621,7 +621,7 @@ $summary: Edit summary for page 'EditFilterMerged': Post-section-merge edit filter $editor: EditPage instance (object) $text: content of the edit box -$error: error message to return +&$error: error message to return $summary: Edit summary for page 'EditFormPreloadText': Allows population of the edit form when creating @@ -631,7 +631,7 @@ new pages 'EditPage::attemptSave': called before an article is saved, that is before insertNewArticle() is called -&$editpage_Obj: the current EditPage object +$editpage_Obj: the current EditPage object 'EditPage::importFormData': allow extensions to read additional data posted in the form diff --git a/includes/EditPage.php b/includes/EditPage.php index 23eb60085f..456152f9f8 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -365,7 +365,7 @@ class EditPage { function edit() { global $wgOut, $wgRequest, $wgEnableJS2system; // Allow extensions to modify/prevent this form or submission - if ( !wfRunHooks( 'AlternateEdit', array( &$this ) ) ) { + if ( !wfRunHooks( 'AlternateEdit', array( $this ) ) ) { return; } @@ -675,7 +675,7 @@ class EditPage { wfProfileOut( $fname ); // Allow extensions to modify form data - wfRunHooks( 'EditPage::importFormData', array( &$this, $request ) ); + wfRunHooks( 'EditPage::importFormData', array( $this, $request ) ); } /** @@ -767,7 +767,7 @@ class EditPage { wfProfileIn( $fname ); wfProfileIn( "$fname-checks" ); - if ( !wfRunHooks( 'EditPage::attemptSave', array( &$this ) ) ) + if ( !wfRunHooks( 'EditPage::attemptSave', array( $this ) ) ) { wfDebug( "Hook 'EditPage::attemptSave' aborted article saving\n" ); return self::AS_HOOK_ERROR; @@ -886,7 +886,7 @@ class EditPage { } // Run post-section-merge edit filter - if ( !wfRunHooks( 'EditFilterMerged', array( &$this, $this->textbox1, &$this->hookError, $this->summary ) ) ) { + if ( !wfRunHooks( 'EditFilterMerged', array( $this, $this->textbox1, &$this->hookError, $this->summary ) ) ) { # Error messages etc. could be handled within the hook... wfProfileOut( $fname ); return self::AS_HOOK_ERROR; @@ -974,7 +974,7 @@ class EditPage { $oldtext = $this->mArticle->getContent(); // Run post-section-merge edit filter - if ( !wfRunHooks( 'EditFilterMerged', array( &$this, $text, &$this->hookError, $this->summary ) ) ) { + if ( !wfRunHooks( 'EditFilterMerged', array( $this, $text, &$this->hookError, $this->summary ) ) ) { # Error messages etc. could be handled within the hook... wfProfileOut( $fname ); return self::AS_HOOK_ERROR; diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index 6475f36d03..a9d489df0c 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -214,7 +214,7 @@ class ApiEditPage extends ApiBase { if(!is_null($params['captchaword'])) $wgRequest->setVal( 'wpCaptchaWord', $params['captchaword'] ); $r = array(); - if(!wfRunHooks('APIEditBeforeSave', array(&$ep, $ep->textbox1, &$r))) + if(!wfRunHooks('APIEditBeforeSave', array($ep, $ep->textbox1, &$r))) { if(count($r)) {