File: echo_api.php

package info (click to toggle)
liboauth-php 0~svn622-1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 104 kB
  • ctags: 255
  • sloc: php: 710; makefile: 8
file content (21 lines) | stat: -rw-r--r-- 490 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
require_once("common.inc.php");

try {
  $req = OAuthRequest::from_request();
  list($consumer, $token) = $test_server->verify_request($req);

  // lsit back the non-OAuth params
  $total = array();
  foreach($req->get_parameters() as $k => $v) {
    if (substr($k, 0, 5) == "oauth") continue;
    $total[] = urlencode($k) . "=" . urlencode($v);
  }
  print implode("&", $total);
} catch (OAuthException $e) {
  print($e->getMessage() . "\n<hr />\n");
  print_r($req);
  die();
}

?>