diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2014-10-06 23:38:47 +0200 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2014-10-06 23:38:47 +0200 |
| commit | 8a7cb8e93bfe3d5220ce50bc8d2aac9e6ce818a2 (patch) | |
| tree | 6bf8430892f8e36c204f74d5d27c10afb48927fe | |
| parent | 81e8558ddd30541782bfefd3b2b0912d1cb6803a (diff) | |
| download | grauphel-8a7cb8e93bfe3d5220ce50bc8d2aac9e6ce818a2.tar.gz grauphel-8a7cb8e93bfe3d5220ce50bc8d2aac9e6ce818a2.zip | |
Try to fix issue #10; work around bug https://bugs.php.net/bug.php?id=68168
| -rw-r--r-- | lib/oauth.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/oauth.php b/lib/oauth.php index 231a177..41af349 100644 --- a/lib/oauth.php +++ b/lib/oauth.php @@ -160,6 +160,17 @@ class OAuth { //$_SERVER['REDIRECT_HTTP_AUTHORIZATION'] = $_SERVER['HTTP_AUTHORIZATION']; //unset($_SERVER['HTTP_AUTHORIZATION']); + if ((isset($_SERVER['HTTP_AUTHORIZATION']) + && strtolower(substr($_SERVER['HTTP_AUTHORIZATION'], 0, 5)) != 'oauth') + || (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']) + && strtolower(substr($_SERVER['REDIRECT_HTTP_AUTHORIZATION'], 0, 5)) != 'oauth') + ) { + //work around bug https://bugs.php.net/bug.php?id=68168 + //#68168: HTTP Basic auth reported as "signature_method_rejected" + throw new \OAuthException( + 'No oauth auth header', OAUTH_PARAMETER_ABSENT + ); + } $params = array(); if (!isset($_SERVER['HTTP_AUTHORIZATION']) |
