Skip to content

Commit

Permalink
Added consumer and access keys to cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Sep 20, 2011
1 parent 99b624f commit ad18e05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion twitter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public function cachedRequest($request, $data = NULL, $cacheExpire = NULL)
$cacheExpire = self::$cacheExpire;
}

$cacheFile = self::$cacheDir . '/twitter.' . md5($request . json_encode($data));
$cacheFile = self::$cacheDir . '/twitter.' . md5($request . json_encode($data) . serialize(array($this->consumer, $this->token)));
$cache = @file_get_contents($cacheFile); // intentionally @
$cache = strncmp($cache, '<', 1) ? @json_decode($cache) : @simplexml_load_string($cache); // intentionally @
if ($cache && @filemtime($cacheFile) + $cacheExpire > time()) { // intentionally @
Expand Down

0 comments on commit ad18e05

Please sign in to comment.