Skip to content
Browse files

Removing magic numbers in CGI HTTP auth.

  • Loading branch information...
1 parent 7e83ecc commit aecd499da7964735bb9dbab3989dafb37b8db0e0 @davidpersson davidpersson committed Jun 29, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 action/Request.php
View
4 action/Request.php
@@ -406,7 +406,7 @@ public function env($key) {
}
}
if (stripos($header, 'basic') === 0) {
- $decoded = base64_decode(substr($header, 6));
+ $decoded = base64_decode(substr($header, strlen('basic ')));
if (strpos($decoded, ':') !== false) {
list($user, $password) = explode(':', $decoded, 2);
@@ -416,7 +416,7 @@ public function env($key) {
return $this->_computed[$key];
}
} elseif (stripos($header, 'digest') === 0) {
- return $this->_computed[$key] = substr($header, 7);
+ return $this->_computed[$key] = substr($header, strlen('digest '));
}
default:
$val = array_key_exists($key, $this->_env) ? $this->_env[$key] : $val;

0 comments on commit aecd499

Please sign in to comment.
Something went wrong with that request. Please try again.