amend source code header + fix read Header + add missing exception

This commit is contained in:
a-sansara 2017-03-13 20:37:22 +01:00
parent 685335992b
commit ba89e1d8bd
4 changed files with 31 additions and 7 deletions

View File

@ -0,0 +1,22 @@
<?php
/*
* This file is part of the pws-auth package.
*
* (c) meta-tech.academy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace MetaTech\PwsAuth;
/*!
* @package MetaTech\PwsAuth
* @package AuthenticateException
* @extends Exception
* @author a-Sansara
* @date 2017-03-13 18:51:46 CET
*/
class AuthenticateException extends \Exception
{
}

View File

@ -1,6 +1,6 @@
<?php <?php
/* /*
* This file is part of the PwsAuth package. * This file is part of the pws-auth package.
* *
* (c) meta-tech.academy * (c) meta-tech.academy
* *
@ -251,10 +251,12 @@ class Authenticator
public function readHeader($arrHeaders) public function readHeader($arrHeaders)
{ {
$headers = []; $headers = [];
foreach($arrHeaders as $h) { if (is_array($arrHeaders)) {
$rs = preg_split('/:/', $h); foreach($arrHeaders as $h) {
if (count($rs)==2) { $rs = preg_split('/:/', $h);
$headers[$rs[0]] = trim($rs[1]); if (count($rs)==2) {
$headers[$rs[0]] = trim($rs[1]);
}
} }
} }
return $headers; return $headers;

View File

@ -1,6 +1,6 @@
<?php <?php
/* /*
* This file is part of the PwsAuth package. * This file is part of the pws-auth package.
* *
* (c) meta-tech.academy * (c) meta-tech.academy
* *

View File

@ -1,6 +1,6 @@
<?php <?php
/* /*
* This file is part of the PwsAuth package. * This file is part of the pws-auth package.
* *
* (c) meta-tech.academy * (c) meta-tech.academy
* *