replace TYPE= with ENGINE=, (supported since 4.0, TYPE deprecated since 4.1)
[lhc/web/wiklou.git] / includes / ImagePage.php
index 24b0e48..0e55156 100644 (file)
@@ -473,7 +473,7 @@ END
        }
 
        function doDelete()     {
-               global $wgOut, $wgUser, $wgRequest, $wgUseSquid, $wgInternalServer;
+               global $wgOut, $wgRequest, $wgUseSquid, $wgInternalServer;
                global $wgPostCommitUpdateList;
 
                $fname = 'ImagePage::doDelete';
@@ -664,6 +664,22 @@ END
                $edit = new EditPage( $this );
                return $edit->blockedIPpage();
        }
+       
+       /**
+        * Override handling of action=purge
+        */
+       function doPurge() {
+               $this->img = new Image( $this->mTitle );
+               if( $this->img->exists() ) {
+                       wfDebug( "ImagePage::doPurge purging " . $this->img->getName() . "\n" );
+                       $linksTo = $this->img->getLinksTo();
+                       Title::touchArray( $linksTo );
+                       $this->img->purgeCache();
+               } else {
+                       wfDebug( "ImagePage::doPurge no image\n" );
+               }
+               parent::doPurge();
+       }
 
 }