Add a function that returns a list of categories the page is a member of
[lhc/web/wiklou.git] / includes / FileDeleteForm.php
index 9fc70eb..65d82b8 100644 (file)
@@ -120,13 +120,7 @@ class FileDeleteForm {
                                // file, otherwise go back to the description page
                                $wgOut->addReturnTo( $this->oldimage ? $this->title : Title::newMainPage() );
 
-                               if ( $wgUser->isLoggedIn() && $wgRequest->getCheck( 'wpWatch' ) != $wgUser->isWatched( $this->title ) ) {
-                                       if ( $wgRequest->getCheck( 'wpWatch' ) ) {
-                                               WatchAction::doWatch( $this->title, $wgUser );
-                                       } else {
-                                               WatchAction::doUnwatch( $this->title, $wgUser );
-                                       }
-                               }
+                               WatchAction::doWatchOrUnwatch( $wgRequest->getCheck( 'wpWatch' ), $this->title, $wgUser );
                        }
                        return;
                }