X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=library%2FOAuth1.php;h=27ee090b114239499c8ac47f5bf04aeec2972ea4;hb=41663c7592abe55a958632c3a48265e0a8544d2b;hp=53b905e7714a5cbdc3d8effc40157d554958ddb5;hpb=2883c8bbc49535cf47fbe53088fad6a150bc3df0;p=friendica.git diff --git a/library/OAuth1.php b/library/OAuth1.php index 53b905e771..27ee090b11 100644 --- a/library/OAuth1.php +++ b/library/OAuth1.php @@ -3,10 +3,10 @@ /* Generic exception class */ -if (!class_exists('OAuthException')) { - class OAuthException extends Exception { - // pass - } +if (!class_exists('OAuthException', false)) { + class OAuthException extends Exception { + // pass + } } class OAuthConsumer { @@ -91,7 +91,6 @@ abstract class OAuthSignatureMethod { */ public function check_signature($request, $consumer, $token, $signature) { $built = $this->build_signature($request, $consumer, $token); - //echo "
"; var_dump($signature, $built, ($built == $signature)); killme(); return ($built == $signature); } } @@ -293,10 +292,9 @@ class OAuthRequest { } // fix for friendica redirect system - $http_url = substr($http_url, 0, strpos($http_url,$parameters['q'])+strlen($parameters['q'])); - unset( $parameters['q'] ); + $http_url = substr($http_url, 0, strpos($http_url,$parameters['pagename'])+strlen($parameters['pagename'])); + unset( $parameters['pagename'] ); - //echo "".__function__."\n"; var_dump($http_method, $http_url, $parameters, $_SERVER['REQUEST_URI']); killme(); return new OAuthRequest($http_method, $http_url, $parameters); } @@ -423,8 +421,11 @@ class OAuthRequest { /** * builds the data one would send in a POST request */ - public function to_postdata() { - return OAuthUtil::build_http_query($this->parameters); + public function to_postdata($raw = false) { + if ($raw) + return($this->parameters); + else + return OAuthUtil::build_http_query($this->parameters); } /** @@ -558,7 +559,6 @@ class OAuthServer { public function verify_request(&$request) { $this->get_version($request); $consumer = $this->get_consumer($request); - //echo __file__.__line__.__function__.""; var_dump($consumer); die(); $token = $this->get_token($request, $consumer, "access"); $this->check_signature($request, $consumer, $token); return array($consumer, $token);