Index: trunk/phase3/includes/api/ApiMove.php |
— | — | @@ -220,7 +220,7 @@ |
221 | 221 | } |
222 | 222 | |
223 | 223 | public function getTokenSalt() { |
224 | | - return null; |
| 224 | + return ''; |
225 | 225 | } |
226 | 226 | |
227 | 227 | protected function getExamples() { |
Index: trunk/phase3/includes/api/ApiRollback.php |
— | — | @@ -123,7 +123,7 @@ |
124 | 124 | } |
125 | 125 | |
126 | 126 | public function getTokenSalt() { |
127 | | - return null; |
| 127 | + return ''; |
128 | 128 | } |
129 | 129 | |
130 | 130 | protected function getExamples() { |
Index: trunk/phase3/includes/api/ApiDelete.php |
— | — | @@ -218,7 +218,7 @@ |
219 | 219 | } |
220 | 220 | |
221 | 221 | public function getTokenSalt() { |
222 | | - return null; |
| 222 | + return ''; |
223 | 223 | } |
224 | 224 | |
225 | 225 | protected function getExamples() { |
Index: trunk/phase3/includes/api/ApiImport.php |
— | — | @@ -150,7 +150,7 @@ |
151 | 151 | } |
152 | 152 | |
153 | 153 | public function getTokenSalt() { |
154 | | - return null; |
| 154 | + return ''; |
155 | 155 | } |
156 | 156 | |
157 | 157 | protected function getExamples() { |
Index: trunk/phase3/includes/api/ApiEditPage.php |
— | — | @@ -458,7 +458,7 @@ |
459 | 459 | } |
460 | 460 | |
461 | 461 | public function getTokenSalt() { |
462 | | - return null; |
| 462 | + return ''; |
463 | 463 | } |
464 | 464 | |
465 | 465 | protected function getExamples() { |
Index: trunk/phase3/includes/api/ApiUnblock.php |
— | — | @@ -117,7 +117,7 @@ |
118 | 118 | } |
119 | 119 | |
120 | 120 | public function getTokenSalt() { |
121 | | - return null; |
| 121 | + return ''; |
122 | 122 | } |
123 | 123 | |
124 | 124 | protected function getExamples() { |
Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -416,14 +416,13 @@ |
417 | 417 | |
418 | 418 | //Die if token required, but not provided (unless there is a gettoken parameter) |
419 | 419 | $salt = $module->getTokenSalt(); |
420 | | - if ( $salt != false ) |
| 420 | + if ( $salt !== false ) |
421 | 421 | { |
422 | 422 | if ( !isset( $moduleParams['token'] ) && !isset( $moduleParams['gettoken'] ) ) { |
423 | 423 | $this->dieUsageMsg( array( 'missingparam', 'token' ) ); |
424 | 424 | } else { |
425 | 425 | global $wgUser; |
426 | | - if ( ( $salt != null && !$wgUser->matchEditToken( $moduleParams['token'], $salt ) ) |
427 | | - || !$wgUser->matchEditToken( $moduleParams['token'] ) ) { |
| 426 | + if ( !$wgUser->matchEditToken( $moduleParams['token'], $salt ) ) { |
428 | 427 | $this->dieUsageMsg( array( 'sessionfailure' ) ); |
429 | 428 | } |
430 | 429 | } |
Index: trunk/phase3/includes/api/ApiEmailUser.php |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | } |
115 | 115 | |
116 | 116 | public function getTokenSalt() { |
117 | | - return null; |
| 117 | + return ''; |
118 | 118 | } |
119 | 119 | |
120 | 120 | protected function getExamples() { |
Index: trunk/phase3/includes/api/ApiBlock.php |
— | — | @@ -166,7 +166,7 @@ |
167 | 167 | } |
168 | 168 | |
169 | 169 | public function getTokenSalt() { |
170 | | - return null; |
| 170 | + return ''; |
171 | 171 | } |
172 | 172 | |
173 | 173 | protected function getExamples() { |
Index: trunk/phase3/includes/api/ApiPatrol.php |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | } |
95 | 95 | |
96 | 96 | public function getTokenSalt() { |
97 | | - return null; |
| 97 | + return ''; |
98 | 98 | } |
99 | 99 | |
100 | 100 | protected function getExamples() { |
Index: trunk/phase3/includes/api/ApiUndelete.php |
— | — | @@ -126,7 +126,7 @@ |
127 | 127 | } |
128 | 128 | |
129 | 129 | public function getTokenSalt() { |
130 | | - return null; |
| 130 | + return ''; |
131 | 131 | } |
132 | 132 | |
133 | 133 | protected function getExamples() { |
Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -970,7 +970,7 @@ |
971 | 971 | } |
972 | 972 | |
973 | 973 | /** |
974 | | - * Returns the token salt if there is one, null if the module doesn't require a salt, else false if the module doesn't need a token |
| 974 | + * Returns the token salt if there is one, '' if the module doesn't require a salt, else false if the module doesn't need a token |
975 | 975 | * @returns bool |
976 | 976 | */ |
977 | 977 | public function getTokenSalt() { |
— | — | @@ -997,7 +997,7 @@ |
998 | 998 | $ret[] = array ( 'writedisabled' ); |
999 | 999 | } |
1000 | 1000 | |
1001 | | - if ( $this->getTokenSalt() != false ) { |
| 1001 | + if ( $this->getTokenSalt() !== false ) { |
1002 | 1002 | $ret[] = array( 'missingparam', 'token' ); |
1003 | 1003 | $ret[] = array( 'sessionfailure' ); |
1004 | 1004 | } |
Index: trunk/phase3/includes/api/ApiUpload.php |
— | — | @@ -343,7 +343,7 @@ |
344 | 344 | } |
345 | 345 | |
346 | 346 | public function getTokenSalt() { |
347 | | - return null; |
| 347 | + return ''; |
348 | 348 | } |
349 | 349 | |
350 | 350 | protected function getExamples() { |