Completed
Push — master ( 7ee1a3...efdf4a )
by Paul
02:33
created
modules/u2f.php 1 patch
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -152,8 +152,7 @@  discard block
 block discarded – undo
152 152
 		if (!empty($secure))
153 153
 		{
154 154
 			return 'on' == strtolower($secure) || '1' == $secure;
155
-		}
156
-		else if ('443' == $this->request->server('SERVER_PORT'))
155
+		} else if ('443' == $this->request->server('SERVER_PORT'))
157 156
 		{
158 157
 			return true;
159 158
 		}
@@ -234,10 +233,12 @@  discard block
 block discarded – undo
234 233
 
235 234
 			if (property_exists($response, 'errorCode'))
236 235
 			{
237
-				if ($response->errorCode == 4) // errorCode 4 means that this device wasn't registered
236
+				if ($response->errorCode == 4) {
237
+					// errorCode 4 means that this device wasn't registered
238 238
 				{
239 239
 					throw new AccessDeniedHttpException($this->user->lang('TFA_NOT_REGISTERED'));
240 240
 				}
241
+				}
241 242
 				throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG'));
242 243
 			}
243 244
 			$result = new AuthenticationResponse($response->signatureData, $response->clientData, $response->keyHandle); // Do not need to include errorCode, as we already handled it.
@@ -251,12 +252,10 @@  discard block
 block discarded – undo
251 252
 
252 253
 			$sql = 'UPDATE ' . $this->registration_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE registration_id = ' . (int) $reg->getId();
253 254
 			$this->db->sql_query($sql);
254
-		}
255
-		catch (U2fError $error)
255
+		} catch (U2fError $error)
256 256
 		{
257 257
 			$this->createError($error);
258
-		}
259
-		catch (\InvalidArgumentException $invalid)
258
+		} catch (\InvalidArgumentException $invalid)
260 259
 		{
261 260
 			throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG') . '<br />' . $invalid->getMessage(), $invalid);
262 261
 		}
@@ -351,8 +350,7 @@  discard block
 block discarded – undo
351 350
 			);
352 351
 
353 352
 			$this->update_session($sql_ary);
354
-		}
355
-		catch (U2fError $err)
353
+		} catch (U2fError $err)
356 354
 		{
357 355
 			$this->createError($err);
358 356
 		}
Please login to merge, or discard this patch.