Index: trunk/phase3/includes/api/ApiDelete.php |
— | — | @@ -78,10 +78,6 @@ |
79 | 79 | $this->dieUsageMsg(reset($retval)); |
80 | 80 | } else { |
81 | 81 | $articleObj = new Article($titleObj); |
82 | | - if($articleObj->isBigDeletion() && !$wgUser->isAllowed('bigdelete')) { |
83 | | - global $wgDeleteRevisionsLimit; |
84 | | - $this->dieUsageMsg(array('delete-toobig', $wgDeleteRevisionsLimit)); |
85 | | - } |
86 | 82 | $retval = self::delete($articleObj, $params['token'], $reason); |
87 | 83 | |
88 | 84 | if(count($retval)) |
— | — | @@ -122,6 +118,10 @@ |
123 | 119 | public static function delete(&$article, $token, &$reason = NULL) |
124 | 120 | { |
125 | 121 | global $wgUser; |
| 122 | + if($article->isBigDeletion() && !$wgUser->isAllowed('bigdelete')) { |
| 123 | + global $wgDeleteRevisionsLimit; |
| 124 | + return array(array('delete-toobig', $wgDeleteRevisionsLimit))); |
| 125 | + } |
126 | 126 | $title = $article->getTitle(); |
127 | 127 | $errors = self::getPermissionsError($title, $token); |
128 | 128 | if (count($errors)) return $errors; |
— | — | @@ -164,7 +164,7 @@ |
165 | 165 | $oldfile = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $title, $oldimage ); |
166 | 166 | |
167 | 167 | if( !FileDeleteForm::haveDeletableFile($file, $oldfile, $oldimage) ) |
168 | | - return array(array('nofile')); |
| 168 | + return self::delete(new Article($title), $token, $reason); |
169 | 169 | if (is_null($reason)) # Log and RC don't like null reasons |
170 | 170 | $reason = ''; |
171 | 171 | $status = FileDeleteForm::doDelete( $title, $file, $oldimage, $reason, $suppress ); |