{
global $wgUser, $wgOut, $wgRequest;
+ if ( !$this->img->exists() || !$this->img->isLocal() ) {
+ # Use standard article deletion
+ Article::delete();
+ return;
+ }
+
$confirm = $wgRequest->wasPosted();
$reason = $wgRequest->getVal( 'wpReason' );
$image = $wgRequest->getVal( 'image' );
# Deleting old images doesn't require confirmation
if ( !is_null( $oldimage ) || $confirm ) {
if( $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) {
- $this->doDelete( $reason );
+ $this->doDeleteImage( $reason );
} else {
$wgOut->showFatalError( wfMsg( 'sessionfailure' ) );
}
/*
* Delete an image.
+ * Called doDeleteImage() not doDelete() so that Article::delete() doesn't
+ * call back to here.
+ *
* @param $reason User provided reason for deletion.
*/
- function doDelete( $reason ) {
+ function doDeleteImage( $reason ) {
global $wgOut, $wgRequest;
$oldimage = $wgRequest->getVal( 'oldimage' );
function restore( /*...*/ ) {
$this->readOnlyError();
}
+ function delete( /*...*/ ) {
+ $this->readOnlyError();
+ }
function getDescriptionUrl() {
// Restore remote behaviour