Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php |
— | — | @@ -52,7 +52,7 @@ |
53 | 53 | * Get an array mapping token names to their handler functions. |
54 | 54 | * The prototype for a token function is func($pageid, $title, $rc) |
55 | 55 | * it should return a token or false (permission denied) |
56 | | - * @return array(tokenname => function) |
| 56 | + * @return array array(tokenname => function) |
57 | 57 | */ |
58 | 58 | protected function getTokenFunctions() { |
59 | 59 | // Don't call the hooks twice |
— | — | @@ -89,7 +89,7 @@ |
90 | 90 | // The patrol token is always the same, let's exploit that |
91 | 91 | static $cachedPatrolToken = null; |
92 | 92 | if ( is_null( $cachedPatrolToken ) ) { |
93 | | - $cachedPatrolToken = $wgUser->editToken( 'patrol' ); |
| 93 | + $cachedPatrolToken = $wgUser->getEditToken( 'patrol' ); |
94 | 94 | } |
95 | 95 | |
96 | 96 | return $cachedPatrolToken; |
Index: trunk/phase3/includes/api/ApiParse.php |
— | — | @@ -390,6 +390,8 @@ |
391 | 391 | /** |
392 | 392 | * @deprecated since 1.18 No modern skin generates language links this way, please use language links |
393 | 393 | * data to generate your own HTML. |
| 394 | + * @param $languages array |
| 395 | + * @return string |
394 | 396 | */ |
395 | 397 | private function languagesHtml( $languages ) { |
396 | 398 | global $wgContLang, $wgHideInterlanguageLinks; |
Index: trunk/phase3/includes/api/ApiQueryDeletedrevs.php |
— | — | @@ -132,7 +132,7 @@ |
133 | 133 | |
134 | 134 | if ( $fld_token ) { |
135 | 135 | // Undelete tokens are identical for all pages, so we cache one here |
136 | | - $token = $user->editToken( '', $this->getMain()->getRequest() ); |
| 136 | + $token = $user->getEditToken( '', $this->getMain()->getRequest() ); |
137 | 137 | } |
138 | 138 | |
139 | 139 | $dir = $params['dir']; |
Index: trunk/phase3/includes/api/ApiDelete.php |
— | — | @@ -98,20 +98,15 @@ |
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
102 | | - * |
103 | | - * @param &$title Title |
| 102 | + * @param $title Title |
104 | 103 | * @param $token String |
| 104 | + * @return array |
105 | 105 | */ |
106 | 106 | private static function getPermissionsError( &$title, $token ) { |
107 | 107 | global $wgUser; |
108 | 108 | |
109 | 109 | // Check permissions |
110 | | - $errors = $title->getUserPermissionsErrors( 'delete', $wgUser ); |
111 | | - if ( count( $errors ) > 0 ) { |
112 | | - return $errors; |
113 | | - } |
114 | | - |
115 | | - return array(); |
| 110 | + return $title->getUserPermissionsErrors( 'delete', $wgUser ); |
116 | 111 | } |
117 | 112 | |
118 | 113 | /** |
Index: trunk/phase3/includes/api/ApiFormatBase.php |
— | — | @@ -235,8 +235,10 @@ |
236 | 236 | public function getBuffer() { |
237 | 237 | return $this->mBuffer; |
238 | 238 | } |
| 239 | + |
239 | 240 | /** |
240 | 241 | * Set the flag to buffer the result instead of printing it. |
| 242 | + * @param $value bool |
241 | 243 | */ |
242 | 244 | public function setBufferResult( $value ) { |
243 | 245 | $this->mBufferResult = $value; |
— | — | @@ -335,6 +337,8 @@ |
336 | 338 | |
337 | 339 | /** |
338 | 340 | * Feed does its own headers |
| 341 | + * |
| 342 | + * @return null |
339 | 343 | */ |
340 | 344 | public function getMimeType() { |
341 | 345 | return null; |
Index: trunk/phase3/includes/api/ApiUnblock.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | $params = $this->extractRequestParams(); |
51 | 51 | |
52 | 52 | if ( $params['gettoken'] ) { |
53 | | - $res['unblocktoken'] = $user->editToken( '', $this->getMain()->getRequest() ); |
| 53 | + $res['unblocktoken'] = $user->getEditToken( '', $this->getMain()->getRequest() ); |
54 | 54 | $this->getResult()->addValue( null, $this->getModuleName(), $res ); |
55 | 55 | return; |
56 | 56 | } |
Index: trunk/phase3/includes/api/ApiQueryUserInfo.php |
— | — | @@ -110,7 +110,7 @@ |
111 | 111 | if ( isset( $this->prop['preferencestoken'] ) && |
112 | 112 | is_null( $this->getMain()->getRequest()->getVal( 'callback' ) ) |
113 | 113 | ) { |
114 | | - $vals['preferencestoken'] = $user->editToken( '', $this->getMain()->getRequest() ); |
| 114 | + $vals['preferencestoken'] = $user->getEditToken( '', $this->getMain()->getRequest() ); |
115 | 115 | } |
116 | 116 | |
117 | 117 | if ( isset( $this->prop['editcount'] ) ) { |
Index: trunk/phase3/includes/api/ApiFeedContributions.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
5 | 4 | * |
6 | 5 | * |
— | — | @@ -206,4 +205,4 @@ |
207 | 206 | public function getVersion() { |
208 | 207 | return __CLASS__ . ': $Id$'; |
209 | 208 | } |
210 | | -} |
\ No newline at end of file |
| 209 | +} |
Index: trunk/phase3/includes/api/ApiBlock.php |
— | — | @@ -52,7 +52,7 @@ |
53 | 53 | $params = $this->extractRequestParams(); |
54 | 54 | |
55 | 55 | if ( $params['gettoken'] ) { |
56 | | - $res['blocktoken'] = $user->editToken( '', $this->getMain()->getRequest() ); |
| 56 | + $res['blocktoken'] = $user->getEditToken( '', $this->getMain()->getRequest() ); |
57 | 57 | $this->getResult()->addValue( null, $this->getModuleName(), $res ); |
58 | 58 | return; |
59 | 59 | } |
Index: trunk/phase3/includes/api/ApiQueryRevisions.php |
— | — | @@ -84,8 +84,8 @@ |
85 | 85 | if ( !$wgUser->isAllowed( 'rollback' ) ) { |
86 | 86 | return false; |
87 | 87 | } |
88 | | - return $wgUser->editToken( array( $title->getPrefixedText(), |
89 | | - $rev->getUserText() ) ); |
| 88 | + return $wgUser->getEditToken( |
| 89 | + array( $title->getPrefixedText(), $rev->getUserText() ) ); |
90 | 90 | } |
91 | 91 | |
92 | 92 | public function execute() { |
Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -436,6 +436,7 @@ |
437 | 437 | * Callback for preg_replace_callback() call in makeHelpMsg(). |
438 | 438 | * Replaces a source file name with a link to ViewVC |
439 | 439 | * |
| 440 | + * @param $matches array |
440 | 441 | * @return string |
441 | 442 | */ |
442 | 443 | public function makeHelpMsg_callback( $matches ) { |
Index: trunk/phase3/includes/api/ApiQueryInfo.php |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | return $cachedEditToken; |
121 | 121 | } |
122 | 122 | |
123 | | - $cachedEditToken = $wgUser->editToken(); |
| 123 | + $cachedEditToken = $wgUser->getEditToken(); |
124 | 124 | return $cachedEditToken; |
125 | 125 | } |
126 | 126 | |
— | — | @@ -134,7 +134,7 @@ |
135 | 135 | return $cachedDeleteToken; |
136 | 136 | } |
137 | 137 | |
138 | | - $cachedDeleteToken = $wgUser->editToken(); |
| 138 | + $cachedDeleteToken = $wgUser->getEditToken(); |
139 | 139 | return $cachedDeleteToken; |
140 | 140 | } |
141 | 141 | |
— | — | @@ -149,7 +149,7 @@ |
150 | 150 | return $cachedProtectToken; |
151 | 151 | } |
152 | 152 | |
153 | | - $cachedProtectToken = $wgUser->editToken(); |
| 153 | + $cachedProtectToken = $wgUser->getEditToken(); |
154 | 154 | return $cachedProtectToken; |
155 | 155 | } |
156 | 156 | |
— | — | @@ -164,7 +164,7 @@ |
165 | 165 | return $cachedMoveToken; |
166 | 166 | } |
167 | 167 | |
168 | | - $cachedMoveToken = $wgUser->editToken(); |
| 168 | + $cachedMoveToken = $wgUser->getEditToken(); |
169 | 169 | return $cachedMoveToken; |
170 | 170 | } |
171 | 171 | |
— | — | @@ -179,7 +179,7 @@ |
180 | 180 | return $cachedBlockToken; |
181 | 181 | } |
182 | 182 | |
183 | | - $cachedBlockToken = $wgUser->editToken(); |
| 183 | + $cachedBlockToken = $wgUser->getEditToken(); |
184 | 184 | return $cachedBlockToken; |
185 | 185 | } |
186 | 186 | |
— | — | @@ -199,7 +199,7 @@ |
200 | 200 | return $cachedEmailToken; |
201 | 201 | } |
202 | 202 | |
203 | | - $cachedEmailToken = $wgUser->editToken(); |
| 203 | + $cachedEmailToken = $wgUser->getEditToken(); |
204 | 204 | return $cachedEmailToken; |
205 | 205 | } |
206 | 206 | |
— | — | @@ -214,7 +214,7 @@ |
215 | 215 | return $cachedImportToken; |
216 | 216 | } |
217 | 217 | |
218 | | - $cachedImportToken = $wgUser->editToken(); |
| 218 | + $cachedImportToken = $wgUser->getEditToken(); |
219 | 219 | return $cachedImportToken; |
220 | 220 | } |
221 | 221 | |
— | — | @@ -229,7 +229,7 @@ |
230 | 230 | return $cachedWatchToken; |
231 | 231 | } |
232 | 232 | |
233 | | - $cachedWatchToken = $wgUser->editToken( 'watch' ); |
| 233 | + $cachedWatchToken = $wgUser->getEditToken( 'watch' ); |
234 | 234 | return $cachedWatchToken; |
235 | 235 | } |
236 | 236 | |
Index: trunk/phase3/includes/api/ApiFeedWatchlist.php |
— | — | @@ -152,6 +152,10 @@ |
153 | 153 | } |
154 | 154 | } |
155 | 155 | |
| 156 | + /** |
| 157 | + * @param $info array |
| 158 | + * @return FeedItem |
| 159 | + */ |
156 | 160 | private function createFeedItem( $info ) { |
157 | 161 | $titleStr = $info['title']; |
158 | 162 | $title = Title::newFromText( $titleStr ); |
Index: trunk/phase3/includes/api/ApiQueryUsers.php |
— | — | @@ -74,7 +74,7 @@ |
75 | 75 | global $wgUser; |
76 | 76 | // Since the permissions check for userrights is non-trivial, |
77 | 77 | // don't bother with it here |
78 | | - return $wgUser->editToken( $user->getName() ); |
| 78 | + return $wgUser->getEditToken( $user->getName() ); |
79 | 79 | } |
80 | 80 | |
81 | 81 | public function execute() { |