Cleaning up some old PHP 4 object-reference usage in some edit filtering hooks.
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 21 Aug 2009 21:51:29 +0000 (21:51 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 21 Aug 2009 21:51:29 +0000 (21:51 +0000)
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.

docs/hooks.txt
includes/EditPage.php
includes/api/ApiEditPage.php

index 0b64a3c..e501533 100644 (file)
@@ -282,7 +282,7 @@ fail, returning an error message or an <edit result="Failure"> 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
index 23eb600..456152f 100644 (file)
@@ -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;
index 6475f36..a9d489d 100644 (file)
@@ -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))
                        {