Index: branches/ApiEdit_Vodafone/includes/api/ApiDelete.php |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | $dbw->immediateBegin(); |
70 | 70 | |
71 | 71 | if ($titleObj->getNamespace() == NS_IMAGE) { |
72 | | - $retval = self::deletefile($params['token'], $titleobj, $params['oldimage'], $reason, false); |
| 72 | + $retval = self::deletefile($params['token'], $titleObj, $params['oldimage'], $reason, false); |
73 | 73 | if(!empty($retval)) |
74 | 74 | // We don't care about multiple errors, just report one of them |
75 | 75 | $this->dieUsageMsg(current($retval)); |
— | — | @@ -92,13 +92,13 @@ |
93 | 93 | $this->getResult()->addValue(null, $this->getModuleName(), $r); |
94 | 94 | } |
95 | 95 | |
96 | | - private static function getPermissionsError($title, $token) { |
| 96 | + private static function getPermissionsError(&$title, $token) { |
97 | 97 | global $wgUser; |
98 | 98 | // Check wiki readonly |
99 | 99 | if (wfReadOnly()) return array(array('readonlytext')); |
100 | 100 | |
101 | 101 | // Check permissions |
102 | | - $errors = $title->getUserPermissionsError('delete', $wgUser); |
| 102 | + $errors = $title->getUserPermissionsErrors('delete', $wgUser); |
103 | 103 | if (count($errors)) return $errors; |
104 | 104 | |
105 | 105 | // Check token |
— | — | @@ -137,7 +137,7 @@ |
138 | 138 | |
139 | 139 | public static function deleteFile($token, &$title, $oldimage, &$reason = NULL, $suppress = false) |
140 | 140 | { |
141 | | - $errors = self::getPermissionsError($article->getTitle(), $token); |
| 141 | + $errors = self::getPermissionsError($title, $token); |
142 | 142 | if (count(errors)) return $errors; |
143 | 143 | |
144 | 144 | if( $oldimage && !FileDeleteForm::isValidOldSpec($oldimage) ) |