Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -502,6 +502,12 @@ |
503 | 503 | { |
504 | 504 | global $wgUser, $wgOut, $wgRequest; |
505 | 505 | |
| 506 | + if ( !$this->img->exists() || !$this->img->isLocal() ) { |
| 507 | + # Use standard article deletion |
| 508 | + Article::delete(); |
| 509 | + return; |
| 510 | + } |
| 511 | + |
506 | 512 | $confirm = $wgRequest->wasPosted(); |
507 | 513 | $reason = $wgRequest->getVal( 'wpReason' ); |
508 | 514 | $image = $wgRequest->getVal( 'image' ); |
— | — | @@ -533,7 +539,7 @@ |
534 | 540 | # Deleting old images doesn't require confirmation |
535 | 541 | if ( !is_null( $oldimage ) || $confirm ) { |
536 | 542 | if( $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) { |
537 | | - $this->doDelete( $reason ); |
| 543 | + $this->doDeleteImage( $reason ); |
538 | 544 | } else { |
539 | 545 | $wgOut->showFatalError( wfMsg( 'sessionfailure' ) ); |
540 | 546 | } |
— | — | @@ -552,9 +558,12 @@ |
553 | 559 | |
554 | 560 | /* |
555 | 561 | * Delete an image. |
| 562 | + * Called doDeleteImage() not doDelete() so that Article::delete() doesn't |
| 563 | + * call back to here. |
| 564 | + * |
556 | 565 | * @param $reason User provided reason for deletion. |
557 | 566 | */ |
558 | | - function doDelete( $reason ) { |
| 567 | + function doDeleteImage( $reason ) { |
559 | 568 | global $wgOut, $wgRequest; |
560 | 569 | |
561 | 570 | $oldimage = $wgRequest->getVal( 'oldimage' ); |
Index: trunk/phase3/includes/filerepo/ForeignDBFile.php |
— | — | @@ -25,6 +25,9 @@ |
26 | 26 | function restore( /*...*/ ) { |
27 | 27 | $this->readOnlyError(); |
28 | 28 | } |
| 29 | + function delete( /*...*/ ) { |
| 30 | + $this->readOnlyError(); |
| 31 | + } |
29 | 32 | |
30 | 33 | function getDescriptionUrl() { |
31 | 34 | // Restore remote behaviour |