* Drop 5.1 compat code
[lhc/web/wiklou.git] / includes / FileDeleteForm.php
index 2dc8d0d..f77d697 100644 (file)
@@ -121,22 +121,20 @@ class FileDeleteForm {
                        $error = '';
                        $dbw = wfGetDB( DB_MASTER );
                        try {
-                               if( wfRunHooks( 'ArticleDelete', array( &$article, &$wgUser, &$reason, &$error ) ) ) {
-                                       // delete the associated article first
-                                       if( $article->doDeleteArticle( $reason, $suppress, $id, false ) ) {
-                                               global $wgRequest;
-                                               if( $wgRequest->getCheck( 'wpWatch' ) && $wgUser->isLoggedIn() ) {
-                                                       $article->doWatch();
-                                               } elseif( $title->userIsWatching() ) {
-                                                       $article->doUnwatch();
-                                               }
-                                               $status = $file->delete( $reason, $suppress );
-                                               if( $status->ok ) {
-                                                       $dbw->commit();
-                                                       wfRunHooks( 'ArticleDeleteComplete', array( &$article, &$wgUser, $reason, $id ) );
-                                               } else {
-                                                       $dbw->rollback();
-                                               }
+                               // delete the associated article first
+                               if( $article->doDeleteArticle( $reason, $suppress, $id, false ) ) {
+                                       global $wgRequest;
+                                       if( $wgRequest->getCheck( 'wpWatch' ) && $wgUser->isLoggedIn() ) {
+                                               $article->doWatch();
+                                       } elseif( $title->userIsWatching() ) {
+                                               $article->doUnwatch();
+                                       }
+                                       $status = $file->delete( $reason, $suppress );
+                                       if( $status->ok ) {
+                                               $dbw->commit();
+                                               wfRunHooks( 'ArticleDeleteComplete', array( &$article, &$wgUser, $reason, $id ) );
+                                       } else {
+                                               $dbw->rollback();
                                        }
                                }
                        } catch ( MWException $e ) {
@@ -174,7 +172,7 @@ class FileDeleteForm {
                        'id' => 'mw-img-deleteconfirm' ) ) .
                        Xml::openElement( 'fieldset' ) .
                        Xml::element( 'legend', null, wfMsg( 'filedelete-legend' ) ) .
-                       Xml::hidden( 'wpEditToken', $wgUser->editToken( $this->oldimage ) ) .
+                       Html::hidden( 'wpEditToken', $wgUser->editToken( $this->oldimage ) ) .
                        $this->prepareMessage( 'filedelete-intro' ) .
                        Xml::openElement( 'table', array( 'id' => 'mw-img-deleteconfirm-table' ) ) .
                        "<tr>