Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 6d36725

Browse files
committed
Simplifies logic for splitting username/credential
Instead of substr operations, we can use the `$limit` argument to `explode()` and achieve the same effect.
1 parent aa367bd commit 6d36725

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Adapter/Http.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,7 @@ protected function _basicAuth($header)
492492
if ($pos === false) {
493493
return $this->challengeClient();
494494
}
495-
$username = substr($auth, 0, $pos);
496-
$password = substr($auth, $pos + 1);
495+
list($username, $password) = explode(':', $auth, 2);
497496

498497
// Fix for ZF-1515: Now re-challenges on empty username or password
499498
if (empty($username) || empty($password)) {

0 commit comments

Comments
 (0)