Revert for now r28986, 28987, 28992 - image redirects.
[lhc/web/wiklou.git] / includes / Article.php
index 86014de..9a7e85b 100644 (file)
@@ -1923,11 +1923,15 @@ class Article {
         */
        function delete() {
                global $wgUser, $wgOut, $wgRequest;
+
                $confirm = $wgRequest->wasPosted() &&
-                       $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) );
-               $this->DeleteReasonList = $wgRequest->getText( 'wpDeleteReasonList' );
+                               $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) );
+               
+               $this->DeleteReasonList = $wgRequest->getText( 'wpDeleteReasonList', 'other' );
                $this->DeleteReason = $wgRequest->getText( 'wpReason' );
+               
                $reason = $this->DeleteReasonList;
+               
                if ( $reason != 'other' && $this->DeleteReason != '') {
                        // Entry from drop down menu + additional comment
                        $reason .= ': ' . $this->DeleteReason;
@@ -2084,22 +2088,22 @@ class Article {
                $wgOut->addHTML( "
 <form id='deleteconfirm' method='post' action=\"{$formaction}\">
        <table border='0'>
-               <tr>
+               <tr id=\"wpDeleteReasonListRow\" name=\"wpDeleteReasonListRow\">
                        <td align='right'>
                                $delcom:
                        </td>
                        <td align='left'>
-                               <select tabindex='2' id='wpDeleteReasonList' name=\"wpDeleteReasonList\">
+                               <select tabindex='1' id='wpDeleteReasonList' name=\"wpDeleteReasonList\">
                                        $deleteReasonList
                                </select>
                        </td>
                </tr>
-               <tr>
+               <tr id=\"wpDeleteReasonRow\" name=\"wpDeleteReasonRow\">
                        <td>
                                $mDeletereasonother
                        </td>
                        <td align='left'>
-                               <input type='text' maxlength='255' size='60' name='wpReason' id='wpReason' value=\"" . htmlspecialchars( $reason ) . "\" tabindex=\"1\" />
+                               <input type='text' maxlength='255' size='60' name='wpReason' id='wpReason' value=\"" . htmlspecialchars( $reason ) . "\" tabindex=\"2\" />
                        </td>
                </tr>
                <tr>
@@ -2360,7 +2364,11 @@ class Article {
                        $summary = wfMsgForContent( 'revertpage', $target->getUserText(), $from );
 
                # Save
-               $flags = EDIT_UPDATE | EDIT_MINOR;
+               $flags = EDIT_UPDATE;
+
+               if ($wgUser->isAllowed('minoredit'))
+                       $flags |= EDIT_MINOR;
+
                if( $bot )
                        $flags |= EDIT_FORCE_BOT;
                $this->doEdit( $target->getText(), $summary, $flags );
@@ -2890,6 +2898,7 @@ class Article {
 
                $title->touchLinks();
                $title->purgeSquid();
+               $title->deleteTitleProtection();
        }
 
        static function onArticleDelete( $title ) {