private function OAuthServer::check_timestamp in OAuth 1.0 7.3
Same name and namespace in other branches
- 6.3 lib/OAuth.php \OAuthServer::check_timestamp()
- 6 OAuth.php \OAuthServer::check_timestamp()
check that the timestamp is new enough
1 call to OAuthServer::check_timestamp()
- OAuthServer::check_signature in lib/
OAuth.php - all-in-one function to check the signature on a request should guess the signature method appropriately
File
- lib/
OAuth.php, line 698 - OAuth 1.0 server and client library.
Class
Code
private function check_timestamp($timestamp) {
if (!$timestamp) {
throw new OAuthException('Missing timestamp parameter. The parameter is required');
}
// verify that timestamp is recentish
$now = time();
if (abs($now - $timestamp) > $this->timestamp_threshold) {
throw new OAuthException("Expired timestamp, yours {$timestamp}, ours {$now}");
}
}