r53386 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53385‎ | r53386 | r53387 >
Date:00:19, 17 July 2009
Author:brion
Status:ok
Tags:
Comment:
throw in a quick hack to disable image deletion/restore if $wgUploadMaintenance is set
Modified paths:
  • /branches/wmf-deployment/includes/DefaultSettings.php (modified) (history)
  • /branches/wmf-deployment/includes/ImagePage.php (modified) (history)
  • /branches/wmf-deployment/includes/specials/SpecialUndelete.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/includes/ImagePage.php
@@ -720,6 +720,13 @@
721721 * Delete the file, or an earlier version of it
722722 */
723723 public function delete() {
 724+ global $wgUploadMaintenance;
 725+ if( $wgUploadMaintenance && $this->mTitle && $this->mTitle->getNamespace() == NS_FILE ) {
 726+ global $wgOut;
 727+ $wgOut->addWikiText('Deletion and restoration of images temporarily disabled during maintenance.' );
 728+ return;
 729+ }
 730+
724731 $this->loadFile();
725732 if( !$this->img->exists() || !$this->img->isLocal() || $this->img->getRedirected() ) {
726733 // Standard article deletion
Index: branches/wmf-deployment/includes/DefaultSettings.php
@@ -3863,3 +3863,6 @@
38643864 * modify the user rights of those users via Special:UserRights
38653865 */
38663866 $wgUserrightsInterwikiDelimiter = '@';
 3867+
 3868+// to disable image delete/restore temporarily
 3869+$wgUploadMaintenance = false;
Index: branches/wmf-deployment/includes/specials/SpecialUndelete.php
@@ -633,6 +633,11 @@
634634 }
635635 }
636636 if( $this->mRestore && $this->mAction == "submit" ) {
 637+ global $wgUploadMaintenance;
 638+ if( $wgUploadMaintenance && $this->mTargetObj && $this->mTargetObj->getNamespace() == NS_FILE ) {
 639+ $wgOut->addWikiText('Deletion and restoration of images temporarily disabled during maintenance.' );
 640+ return;
 641+ }
637642 return $this->undelete();
638643 }
639644 if( $this->mInvert && $this->mAction == "submit" ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r56215Forward-port image manipulation disabling hack from wmf-deployment r53386....brion23:36, 11 September 2009

Status & tagging log