123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <?php
- if (!defined('STATUSNET')) {
- exit(1);
- }
- require_once INSTALLDIR . '/lib/apiaction.php';
- class ApiOAuthAction extends ApiAction
- {
-
- function isReadOnly($args)
- {
- return false;
- }
- function prepare($args)
- {
- parent::prepare($args);
- return true;
- }
-
- function handle($args)
- {
- parent::handle($args);
- self::cleanRequest();
- }
-
- static function cleanRequest()
- {
-
- if (get_magic_quotes_gpc() == 1) {
- $_POST = array_map('stripslashes', $_POST);
- $_GET = array_map('stripslashes', $_GET);
- }
-
- unset($_GET['p']);
- unset($_POST['p']);
- unset($_REQUEST['p']);
- $queryArray = explode('&', $_SERVER['QUERY_STRING']);
- for ($i = 0; $i < sizeof($queryArray); $i++) {
- if (substr($queryArray[$i], 0, 2) == 'p=') {
- unset($queryArray[$i]);
- }
- }
- $_SERVER['QUERY_STRING'] = implode('&', $queryArray);
- }
- }
|