Index: branches/ApiEdit_Vodafone/includes/api/ApiDelete.php |
— | — | @@ -99,7 +99,7 @@ |
100 | 100 | |
101 | 101 | // Check permissions |
102 | 102 | $errors = $title->getUserPermissionsErrors('delete', $wgUser); |
103 | | - if (count($errors)) return $errors; |
| 103 | + if (count($errors) > 0) return $errors; |
104 | 104 | |
105 | 105 | // Check token |
106 | 106 | if(!$wgUser->matchEditToken($token)) |
— | — | @@ -118,9 +118,8 @@ |
119 | 119 | public static function delete(&$article, $token, &$reason = NULL) |
120 | 120 | { |
121 | 121 | $errors = self::getPermissionsError($article->getTitle(), $token); |
122 | | - if (count(errors)) return $errors; |
| 122 | + if (count($errors)) return $errors; |
123 | 123 | |
124 | | - |
125 | 124 | // Auto-generate a summary, if necessary |
126 | 125 | if(is_null($reason)) |
127 | 126 | { |
— | — | @@ -139,7 +138,7 @@ |
140 | 139 | public static function deleteFile($token, &$title, $oldimage, &$reason = NULL, $suppress = false) |
141 | 140 | { |
142 | 141 | $errors = self::getPermissionsError($title, $token); |
143 | | - if (count(errors)) return $errors; |
| 142 | + if (count($errors)) return $errors; |
144 | 143 | |
145 | 144 | if( $oldimage && !FileDeleteForm::isValidOldSpec($oldimage) ) |
146 | 145 | return array(array('invalidoldimage')); |
— | — | @@ -153,7 +152,7 @@ |
154 | 153 | if( !FileDeleteForm::haveDeletableFile($file, $oldfile, $oldimage) ) |
155 | 154 | return array(array('nofile')); |
156 | 155 | |
157 | | - $status = self::doDelete( $title, $file, $oldimage, $reason, $suppress ); |
| 156 | + $status = FileDeleteForm::doDelete( $title, $file, $oldimage, $reason, $suppress ); |
158 | 157 | |
159 | 158 | if( !$status->isGood() ) |
160 | 159 | return array(array('cannotdelete', $title->getPrefixedText())); |