diff options
author | Thomas Citharel <thomas.citharet@gmail.com> | 2013-09-26 22:00:44 +0200 |
---|---|---|
committer | Thomas Citharel <thomas.citharet@gmail.com> | 2013-09-26 22:00:44 +0200 |
commit | be2b9055b9019fccc9d2e4678494d0ffcd5f5f12 (patch) | |
tree | 858f402df9aa547b17e431d62f6382928832bbab | |
parent | 3408ed48ba66db8d93207507777be42759f7eb0a (diff) | |
download | wallabag-be2b9055b9019fccc9d2e4678494d0ffcd5f5f12.tar.gz wallabag-be2b9055b9019fccc9d2e4678494d0ffcd5f5f12.tar.zst wallabag-be2b9055b9019fccc9d2e4678494d0ffcd5f5f12.zip |
Changed url's encryption from base64 to md5
Fixes Issue #243.
md5 hashes are only coded on 32 hexadecimal characters, so it won't make
too long file names.
-rw-r--r-- | inc/3rdparty/FlattrItem.class.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/inc/3rdparty/FlattrItem.class.php b/inc/3rdparty/FlattrItem.class.php index c940fcd6..ab5ed81d 100644 --- a/inc/3rdparty/FlattrItem.class.php +++ b/inc/3rdparty/FlattrItem.class.php | |||
@@ -11,7 +11,7 @@ class FlattrItem { | |||
11 | 11 | ||
12 | public function checkItem($urltoflattr) { | 12 | public function checkItem($urltoflattr) { |
13 | $this->cacheflattrfile($urltoflattr); | 13 | $this->cacheflattrfile($urltoflattr); |
14 | $flattrResponse = file_get_contents(CACHE . "/flattr/".base64_encode($urltoflattr).".cache"); | 14 | $flattrResponse = file_get_contents(CACHE . "/flattr/".md5($urltoflattr).".cache"); |
15 | if($flattrResponse != FALSE) { | 15 | if($flattrResponse != FALSE) { |
16 | $result = json_decode($flattrResponse); | 16 | $result = json_decode($flattrResponse); |
17 | if (isset($result->message)){ | 17 | if (isset($result->message)){ |
@@ -39,9 +39,9 @@ class FlattrItem { | |||
39 | } | 39 | } |
40 | 40 | ||
41 | // if a cache flattr file for this url already exists and it's been less than one day than it have been updated, see in /cache | 41 | // if a cache flattr file for this url already exists and it's been less than one day than it have been updated, see in /cache |
42 | if ((!file_exists(CACHE . "/flattr/".base64_encode($urltoflattr).".cache")) || (time() - filemtime(CACHE . "/flattr/".base64_encode($urltoflattr).".cache") > 86400)) { | 42 | if ((!file_exists(CACHE . "/flattr/".md5($urltoflattr).".cache")) || (time() - filemtime(CACHE . "/flattr/".md5($urltoflattr).".cache") > 86400)) { |
43 | $askForFlattr = Tools::getFile(FLATTR_API . $urltoflattr); | 43 | $askForFlattr = Tools::getFile(FLATTR_API . $urltoflattr); |
44 | $flattrCacheFile = fopen(CACHE . "/flattr/".base64_encode($urltoflattr).".cache", 'w+'); | 44 | $flattrCacheFile = fopen(CACHE . "/flattr/".md5($urltoflattr).".cache", 'w+'); |
45 | fwrite($flattrCacheFile, $askForFlattr); | 45 | fwrite($flattrCacheFile, $askForFlattr); |
46 | fclose($flattrCacheFile); | 46 | fclose($flattrCacheFile); |
47 | } | 47 | } |