You are here

private function OAuthServer::check_timestamp in jQuery social stream 8.2

Same name and namespace in other branches
  1. 8 src/Twitter/OAuthServer.php \Drupal\jquery_social_stream\Twitter\OAuthServer::check_timestamp()

check that the timestamp is new enough

1 call to OAuthServer::check_timestamp()
OAuthServer::check_signature in src/Twitter/OAuthServer.php
all-in-one function to check the signature on a request should guess the signature method appropriately

File

src/Twitter/OAuthServer.php, line 179

Class

OAuthServer

Namespace

Drupal\jquery_social_stream\Twitter

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}");
  }
}