From: Christian Weiske Date: Mon, 6 Oct 2014 21:38:47 +0000 (+0200) Subject: Try to fix issue #10; work around bug https://bugs.php.net/bug.php?id=68168 X-Git-Tag: v0.3.0~14 X-Git-Url: https://git.cweiske.de/grauphel.git/commitdiff_plain/8a7cb8e93bfe3d5220ce50bc8d2aac9e6ce818a2 Try to fix issue #10; work around bug https://bugs.php.net/bug.php?id=68168 --- 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'])