From: Zach Copley Date: Tue, 5 Oct 2010 01:21:50 +0000 (+0000) Subject: Strip out the special 'p' paramter added by index.php from X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=06d918d575cfb112b8719b0441548d55e679fe51;p=quix0rs-gnu-social.git Strip out the special 'p' paramter added by index.php from $_SERVER['QUERY_STRING'] before doing OAuth requests. Required by the latest version of the OAuth lib. --- diff --git a/lib/apioauth.php b/lib/apioauth.php index 1c87e42324..3f71de0c35 100644 --- a/lib/apioauth.php +++ b/lib/apioauth.php @@ -86,11 +86,18 @@ class ApiOauthAction extends Action } // strip out the p param added in index.php - - // XXX: should we strip anything else? Or alternatively - // only allow a known list of params? 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, 1) == 'p=') { + unset($queryArray[$i]); + } + } + + $_SERVER['QUERY_STRING'] = implode('&', $queryString); } function getCallback($url, $params)