@@ -30,8 +30,7 @@ |
||
| 30 | 30 | public function authenticate(User $user, $data) |
| 31 | 31 | { |
| 32 | 32 | $storedData = $this->getCredentialData($user->getId()); |
| 33 | - if($storedData === null) |
|
| 34 | - { |
|
| 33 | + if($storedData === null) { |
|
| 35 | 34 | // No available credential matching these parameters |
| 36 | 35 | return false; |
| 37 | 36 | } |
@@ -263,7 +263,7 @@ |
||
| 263 | 263 | "dsrcname" => "mysql:host=" . $toolserver_host . ";dbname=" . $toolserver_database, |
| 264 | 264 | "username" => $toolserver_username, |
| 265 | 265 | "password" => $toolserver_password, |
| 266 | - "options" => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4'), |
|
| 266 | + "options" => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4'), |
|
| 267 | 267 | ), |
| 268 | 268 | "wikipedia" => array( |
| 269 | 269 | "dsrcname" => "mysql:host=" . $antispoof_host . ";dbname=" . $antispoof_db, |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | { |
| 33 | 33 | $useOAuthSignup = $this->getSiteConfiguration()->getUseOAuthSignup(); |
| 34 | 34 | if (! $this->getSiteConfiguration()->isRegistrationAllowed()) { |
| 35 | - throw new AccessDeniedException(); |
|
| 35 | + throw new AccessDeniedException(); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | // Dual-mode page |
@@ -241,19 +241,19 @@ |
||
| 241 | 241 | */ |
| 242 | 242 | public function setForwardedIp($forwardedip) |
| 243 | 243 | { |
| 244 | - // Verify that the XFF chain only contains valid IP addresses, and silently discard anything that isn't. |
|
| 244 | + // Verify that the XFF chain only contains valid IP addresses, and silently discard anything that isn't. |
|
| 245 | 245 | |
| 246 | - $xff = explode(',', $forwardedip); |
|
| 247 | - $valid = array(); |
|
| 246 | + $xff = explode(',', $forwardedip); |
|
| 247 | + $valid = array(); |
|
| 248 | 248 | |
| 249 | - foreach ($xff as $ip) { |
|
| 250 | - $ip = trim($ip); |
|
| 251 | - if (filter_var($ip, FILTER_VALIDATE_IP)) { |
|
| 252 | - $valid[] = $ip; |
|
| 253 | - } |
|
| 254 | - } |
|
| 249 | + foreach ($xff as $ip) { |
|
| 250 | + $ip = trim($ip); |
|
| 251 | + if (filter_var($ip, FILTER_VALIDATE_IP)) { |
|
| 252 | + $valid[] = $ip; |
|
| 253 | + } |
|
| 254 | + } |
|
| 255 | 255 | |
| 256 | - $this->forwardedip = implode(", ", $valid); |
|
| 256 | + $this->forwardedip = implode(", ", $valid); |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | /** |
@@ -28,15 +28,15 @@ |
||
| 28 | 28 | return (bool)$dontUseDb; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Gets the offline message |
|
| 33 | - * |
|
| 34 | - * @param bool $external |
|
| 35 | - * @param null|string $message |
|
| 36 | - * |
|
| 37 | - * @return string |
|
| 38 | - * @throws SmartyException |
|
| 39 | - */ |
|
| 31 | + /** |
|
| 32 | + * Gets the offline message |
|
| 33 | + * |
|
| 34 | + * @param bool $external |
|
| 35 | + * @param null|string $message |
|
| 36 | + * |
|
| 37 | + * @return string |
|
| 38 | + * @throws SmartyException |
|
| 39 | + */ |
|
| 40 | 40 | public static function getOfflineMessage($external, $message = null) |
| 41 | 41 | { |
| 42 | 42 | global $dontUseDbCulprit, $dontUseDbReason, $baseurl; |
@@ -190,7 +190,8 @@ |
||
| 190 | 190 | $endpoint = $this->siteConfiguration->getMetaWikimediaWebServiceEndpoint(); |
| 191 | 191 | $response = $this->httpHelper->get($endpoint, $parameters); |
| 192 | 192 | $response = json_decode($response, true); |
| 193 | - } catch (CurlException $ex) { |
|
| 193 | + } |
|
| 194 | + catch (CurlException $ex) { |
|
| 194 | 195 | // failed getting identification status, so throw a nicer error. |
| 195 | 196 | $message = 'Could not contact metawiki API to determine user\' identification status. ' |
| 196 | 197 | . 'This is probably a transient error, so please try again.'; |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | { |
| 348 | 348 | $userIds = array(); |
| 349 | 349 | |
| 350 | - foreach ($logs as $logEntry) { |
|
| 350 | + foreach ($logs as $logEntry) { |
|
| 351 | 351 | if (!$logEntry instanceof Log) { |
| 352 | 352 | // if this happens, we've done something wrong with passing back the log data. |
| 353 | 353 | throw new Exception('Log entry is not an instance of a Log, this should never happen.'); |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | |
| 369 | 369 | $logData = array(); |
| 370 | 370 | |
| 371 | - foreach ($logs as $logEntry) { |
|
| 371 | + foreach ($logs as $logEntry) { |
|
| 372 | 372 | $objectDescription = self::getObjectDescription($logEntry->getObjectId(), $logEntry->getObjectType(), |
| 373 | 373 | $database, $configuration); |
| 374 | 374 | |