/** * Extracts the 'st' token from the GET or POST params and calls the * signer to validate the token * * @param GadgetSigner $signer the signer to use (configured in config.php) * @return string the token to use in the signed url */ private function extractAndValidateToken($signer) { if ($signer == null) { return null; } $token = isset($_GET["st"]) ? $_GET["st"] : false; if ($token) { $token = isset($_POST['st']) ? $_POST['st'] : ''; } return $signer->createToken($token); }
/** * Extracts the 'st' token from the GET or POST params and calls the * signer to validate the token * * @param GadgetSigner $signer the signer to use (configured in config.php) * @return string the token to use in the signed url */ public function extractAndValidateToken($signer) { if ($signer == null) { return null; } $token = isset($_GET["st"]) ? $_GET["st"] : ''; if (!isset($token) || $token == '') { $token = isset($_POST['st']) ? $_POST['st'] : ''; } if (count(explode(':', $token)) != 6) { $token = urldecode(base64_decode($token)); } return $signer->createToken($token); }