X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=library%2FOAuth1.php;h=a2097be064b2c78cf698d733e9ce0cbcb3daa175;hb=e568020718c351bf64e8b2cb678427750b498ed6;hp=604945265f6f569c9dc3b7fdf24858c59762bfe2;hpb=ff7fc68382bf1359adc31bd65bb6786b7f63e31a;p=friendica.git diff --git a/library/OAuth1.php b/library/OAuth1.php index 604945265f..a2097be064 100644 --- a/library/OAuth1.php +++ b/library/OAuth1.php @@ -3,8 +3,10 @@ /* Generic exception class */ -class OAuthException extends Exception { - // pass +if (!class_exists('OAuthException')) { + class OAuthException extends Exception { + // pass + } } class OAuthConsumer { @@ -27,6 +29,10 @@ class OAuthToken { public $key; public $secret; + public $expires; + public $scope; + public $uid; + /** * key = the token * secret = the token secret @@ -285,10 +291,10 @@ class OAuthRequest { } } - // fix for friendika redirect system + // 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);
@@ -417,8 +423,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);
   }
 
   /**
@@ -552,6 +561,7 @@ 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);