From: Antoine Musso Date: Tue, 11 Jul 2006 19:58:08 +0000 (+0000) Subject: Code quality: makes imagePage::doDelete compatible with article::doDelete X-Git-Tag: 1.31.0-rc.0~56287 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/journal.php?a=commitdiff_plain;h=61967dadc4dfc3ca8eb33e56eae93efe729c4c13;p=lhc%2Fweb%2Fwiklou.git Code quality: makes imagePage::doDelete compatible with article::doDelete --- 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 );