Removing pass by reference, and making the $error argument for doDeleteArticle a...
authorRyan Lane <laner@users.mediawiki.org>
Wed, 23 Mar 2011 22:13:09 +0000 (22:13 +0000)
committerRyan Lane <laner@users.mediawiki.org>
Wed, 23 Mar 2011 22:13:09 +0000 (22:13 +0000)
includes/Article.php
includes/api/ApiDelete.php

index 3ce95b6..e950a03 100644 (file)
@@ -3052,7 +3052,7 @@ class Article {
                $id = $this->mTitle->getArticleID( Title::GAID_FOR_UPDATE );
 
                $error = '';
-               if ( $this->doDeleteArticle( $reason, $suppress, $id, &$error ) ) {
+               if ( $this->doDeleteArticle( $reason, $suppress, $id, $error ) ) {
                        $deleted = $this->mTitle->getPrefixedText();
 
                        $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
@@ -3099,7 +3099,7 @@ class Article {
         * @param $commit boolean defaults to true, triggers transaction end
         * @return boolean true if successful
         */
-       public function doDeleteArticle( $reason, $suppress = false, $id = 0, $commit = true, $error='' ) {
+       public function doDeleteArticle( $reason, $suppress = false, $id = 0, $commit = true, &$error='' ) {
                global $wgDeferredUpdateList, $wgUseTrackbacks;
 
                wfDebug( __METHOD__ . "\n" );
index d05723e..0eba219 100644 (file)
@@ -147,7 +147,7 @@ class ApiDelete extends ApiBase {
 
                $error = '';
                // Luckily, Article.php provides a reusable delete function that does the hard work for us
-               if ( $article->doDeleteArticle( $reason, false, 0, true, &$error ) ) {
+               if ( $article->doDeleteArticle( $reason, false, 0, true, $error ) ) {
                        return array();
                } else {
                        return array( array( 'cannotdelete', $article->mTitle->getPrefixedText() ) );