From 09a981ba383170d8a56d97fa1b46937150d4ef22 Mon Sep 17 00:00:00 2001 From: Nicola Beghin Date: Sun, 23 Apr 2017 18:44:42 +0200 Subject: [PATCH] code style fix as requested --- lib/Cake/Controller/Component/Auth/BasicAuthenticate.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php b/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php index 8e98fda21..b7daa74f4 100644 --- a/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php +++ b/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php @@ -82,12 +82,9 @@ class BasicAuthenticate extends BaseAuthenticate { * @return mixed Either false or an array of user information */ public function getUser(CakeRequest $request) { - $username = ''; - $pass = ''; - if (isset($_SERVER['PHP_AUTH_USER'])) { - $username = env('PHP_AUTH_USER'); - $pass = env('PHP_AUTH_PW'); - } else { + $username = env('PHP_AUTH_USER'); + $pass = env('PHP_AUTH_PW'); + if (empty($username)) { $httpAuthorization = $request->header('Authorization'); if ($httpAuthorization !== false && strlen($httpAuthorization) > 0 && strpos($httpAuthorization, 'Basic') !== false) { list($username, $pass) = explode(':', base64_decode(substr($httpAuthorization, 6)));