From: Andrew Garrett Date: Thu, 29 Jan 2009 01:04:00 +0000 (+0000) Subject: Fix broken calls to ArticleDelete hook. X-Git-Tag: 1.31.0-rc.0~43149 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=0fcc01739122d29b2845d2c494bd5f796e508be2;p=lhc%2Fweb%2Fwiklou.git Fix broken calls to ArticleDelete hook. --- diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php index 3af9813a28..5177d35fe7 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -108,7 +108,8 @@ class FileDeleteForm { $id = $title->getArticleID( GAID_FOR_UPDATE ); // Need to delete the associated article $article = new Article( $title ); - if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason)) ) { + $error = ''; + if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason, &$error)) ) { if( $article->doDeleteArticle( $reason, $suppress, $id ) ) { global $wgRequest; if( $wgRequest->getCheck( 'wpWatch' ) ) { diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index 8a4040dd80..a892b1c86f 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -137,9 +137,10 @@ class ApiDelete extends ApiBase { if($reason === false) return array(array('cannotdelete')); } - - if (!wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason))) - $this->dieUsageMsg(array('hookaborted')); + + $error = ''; + if (!wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason, $error))) + $this->dieUsageMsg(array('hookaborted', $error)); // Luckily, Article.php provides a reusable delete function that does the hard work for us if($article->doDeleteArticle($reason)) {