Skip to content
Permalink
Browse files

BasicAuthenticate - code styling and strong type comparison

  • Loading branch information...
nicolabeghin committed Mar 15, 2017
1 parent 41851d6 commit f5795f05a5409cd6e8ae5b1a8742cf17e346b425
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/Cake/Controller/Component/Auth/BasicAuthenticate.php
@@ -85,9 +85,8 @@ public function getUser(CakeRequest $request) {
if(!isset($_SERVER['PHP_AUTH_USER'])) {
if (isset($_SERVER['HTTP_AUTHORIZATION']) && (strlen($_SERVER['HTTP_AUTHORIZATION']) > 0)) {
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
if( strlen($_SERVER['PHP_AUTH_USER']) == 0 || strlen($_SERVER['PHP_AUTH_PW']) == 0 ) {
unset($_SERVER['PHP_AUTH_USER']);
unset($_SERVER['PHP_AUTH_PW']);
if(strlen($_SERVER['PHP_AUTH_USER']) === 0 || strlen($_SERVER['PHP_AUTH_PW']) === 0) {
unset($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
}
}
}

0 comments on commit f5795f0

Please sign in to comment.
You can’t perform that action at this time.