diff options
author | Andrew Dolgov <[email protected]> | 2021-09-01 08:25:41 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-09-01 08:25:41 +0300 |
commit | b5a956422a497b560c8645d6828e638ffe4f1ae4 (patch) | |
tree | fdcc4ccb3d737a194643f7330851e2f92eef4490 | |
parent | 3f8275459884a731d47dfc9279bf2d2545117d6b (diff) |
rewrite_url_if_needed: properly enforce MAX_WIDTH
-rw-r--r-- | init.php | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -274,6 +274,9 @@ class Api_Resize_Media extends Plugin { private function rewrite_url_if_needed($url, $width, $force_stamp = false) { if (strpos($url, "data:") !== 0 && $width > 0) { + if ($width > self::MAX_WIDTH) + $width = self::MAX_WIDTH; + $local_filename = sha1($url) . "-$width"; if ($this->cache->exists($local_filename)) { |