Another fix for bug #10
[grauphel.git] / lib / oauth.php
index 41af349..9fea742 100644 (file)
@@ -161,8 +161,10 @@ class OAuth
         //$_SERVER['REDIRECT_HTTP_AUTHORIZATION'] = $_SERVER['HTTP_AUTHORIZATION'];
         //unset($_SERVER['HTTP_AUTHORIZATION']);
         if ((isset($_SERVER['HTTP_AUTHORIZATION'])
         //$_SERVER['REDIRECT_HTTP_AUTHORIZATION'] = $_SERVER['HTTP_AUTHORIZATION'];
         //unset($_SERVER['HTTP_AUTHORIZATION']);
         if ((isset($_SERVER['HTTP_AUTHORIZATION'])
+                && strlen($_SERVER['HTTP_AUTHORIZATION'])
                 && strtolower(substr($_SERVER['HTTP_AUTHORIZATION'], 0, 5)) != 'oauth')
             || (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])
                 && strtolower(substr($_SERVER['HTTP_AUTHORIZATION'], 0, 5)) != 'oauth')
             || (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])
+                && strlen($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])
                 && strtolower(substr($_SERVER['REDIRECT_HTTP_AUTHORIZATION'], 0, 5)) != 'oauth')
         ) {
             //work around bug https://bugs.php.net/bug.php?id=68168
                 && strtolower(substr($_SERVER['REDIRECT_HTTP_AUTHORIZATION'], 0, 5)) != 'oauth')
         ) {
             //work around bug https://bugs.php.net/bug.php?id=68168