summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian A. Weber2017-03-21 14:42:05 +0100
committerChristian A. Weber2017-03-21 14:43:16 +0100
commitf366953bd8aabeb7f4be7d33dc8d358a4839d8ba (patch)
tree2d099e203a9d55ac74b76662764d02890466fa55
parent80f1b687006f2bf1844e6d79b3e9c6362041b7ef (diff)
downloaditools-f366953bd8aabeb7f4be7d33dc8d358a4839d8ba.tar.gz
itools-f366953bd8aabeb7f4be7d33dc8d358a4839d8ba.tar.bz2
itools-f366953bd8aabeb7f4be7d33dc8d358a4839d8ba.zip
get_cache_filename() considers post data
-rw-r--r--it_url.class3
1 files changed, 2 insertions, 1 deletions
diff --git a/it_url.class b/it_url.class
index 7355463..4f184ac 100644
--- a/it_url.class
+++ b/it_url.class
@@ -464,6 +464,7 @@ static function get_cache_dir($p)
* Construct a local file name to cache an URL. Named args:
* @param $p['url'] remote url to get
* @param $p['cachedir'] directory to store cache files in, @see get_cache_dir
+ * @param $p['data'] POST data array with key-value pairs
* @param $p['id'] If you need more than one type of cache (e.g. different maxage) you can specify an id
*/
static function get_cache_filename($p)
@@ -472,7 +473,7 @@ static function get_cache_filename($p)
$p = array('url'=>$p);
$p['cachedir'] = it_url::get_cache_dir($p);
- $filename = md5(T_lang() . $p['url'] . ($p['headers'] ? serialize($p['headers']) : ""));
+ $filename = md5(T_lang() . $p['url'] . ($p['headers'] ? serialize($p['headers']) : "") . ($p['data'] ? serialize($p['data']) : ""));
return $p['cachedir'] . "/" . substr($filename, 0, 2) . "/$filename";
}