From 5fb1b71cb62b12631a85b139668273b63dfc6f06 Mon Sep 17 00:00:00 2001 From: Nicola Beghin Date: Wed, 15 Mar 2017 17:22:31 +0100 Subject: [PATCH] code style fix --- .../Controller/Component/Auth/BasicAuthenticate.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) mode change 100644 => 100755 lib/Cake/Controller/Component/Auth/BasicAuthenticate.php diff --git a/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php b/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php old mode 100644 new mode 100755 index 6e5d666ba..e3a9326c7 --- a/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php +++ b/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php @@ -84,12 +84,12 @@ class BasicAuthenticate extends BaseAuthenticate { public function getUser(CakeRequest $request) { if(!isset($_SERVER['PHP_AUTH_USER'])) { $httpAuthorization = $request->header('Authorization'); - if ($httpAuthorization !== false && strlen($httpAuthorization) > 0 && strpos($httpAuthorization, 'basic') !== false) { - list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($httpAuthorization, 6))); - if(strlen($_SERVER['PHP_AUTH_USER']) === 0 || strlen($_SERVER['PHP_AUTH_PW']) === 0) { - unset($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']); - } - } + if($httpAuthorization !== false && strlen($httpAuthorization) > 0 && strpos($httpAuthorization, 'basic') !== false) { + list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($httpAuthorization, 6))); + if(strlen($_SERVER['PHP_AUTH_USER']) === 0 || strlen($_SERVER['PHP_AUTH_PW']) === 0) { + unset($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']); + } + } } $username = env('PHP_AUTH_USER'); $pass = env('PHP_AUTH_PW');