diff options
author | Andrew Dolgov <[email protected]> | 2019-08-14 09:49:18 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-08-14 09:49:18 +0300 |
commit | 3c075bfd21adac9a4dde4fab6bd22886d6173d30 (patch) | |
tree | 29e29d6fbb1ce196c5af807338c8a56abf518f85 /classes/article.php | |
parent | 65450f8a2bbf325d26177c2589c3a9bbe67d8f80 (diff) |
DiskCache: more strict checking for input filenames, getUrl() is no longer static
Diffstat (limited to 'classes/article.php')
-rwxr-xr-x | classes/article.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/classes/article.php b/classes/article.php index 62ea1f3b9..67b1a4a05 100755 --- a/classes/article.php +++ b/classes/article.php @@ -673,10 +673,12 @@ class Article extends Handler_Protected { $rv = array(); + $cache = new DiskCache("images"); + while ($line = $sth->fetch()) { - if (file_exists(CACHE_DIR . '/images/' . sha1($line["content_url"]))) { - $line["content_url"] = DiskCache::getUrl(sha1($line["content_url"])); + if ($cache->exists(sha1($line["content_url"]))) { + $line["content_url"] = $cache->getUrl(sha1($line["content_url"])); } array_push($rv, $line); |