aboutsummaryrefslogtreecommitdiff
path: root/lib/oauth.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oauth.php')
-rw-r--r--lib/oauth.php11
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'])