From 61967dadc4dfc3ca8eb33e56eae93efe729c4c13 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 11 Jul 2006 19:58:08 +0000 Subject: [PATCH] Code quality: makes imagePage::doDelete compatible with article::doDelete --- includes/ImagePage.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 8a865a9d30..7e8709087b 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -435,6 +435,7 @@ END global $wgUser, $wgOut, $wgRequest; $confirm = $wgRequest->wasPosted(); + $reason = $wgRequest->getVal( 'wpReason' ); $image = $wgRequest->getVal( 'image' ); $oldimage = $wgRequest->getVal( 'oldimage' ); @@ -465,7 +466,7 @@ END # Deleting old images doesn't require confirmation if ( !is_null( $oldimage ) || $confirm ) { if( $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) { - $this->doDelete(); + $this->doDelete( $reason ); } else { $wgOut->showFatalError( wfMsg( 'sessionfailure' ) ); } @@ -482,13 +483,16 @@ END return $this->confirmDelete( $q, $wgRequest->getText( 'wpReason' ) ); } - function doDelete() { + /* + * Delete an image. + * @param $reason User provided reason for deletion. + */ + function doDelete( $reason ) { global $wgOut, $wgRequest, $wgUseSquid; global $wgPostCommitUpdateList; $fname = 'ImagePage::doDelete'; - $reason = $wgRequest->getVal( 'wpReason' ); $oldimage = $wgRequest->getVal( 'oldimage' ); $dbw =& wfGetDB( DB_MASTER ); -- 2.20.1