diff options
author | Andrew Dolgov <[email protected]> | 2016-02-19 09:39:11 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2016-02-19 09:39:11 +0300 |
commit | b501dc3c5a76b9b5888c596c9a5a2b6dbff478ca (patch) | |
tree | 86c8c180ad7f89f87afff35a71288dd35bcec939 /include/functions2.php | |
parent | 1003f71e0459b4b5e7d5e7b393d0baba02e82808 (diff) | |
parent | a01bfd78c2a8240a6f73ec16098fc8a3ff6e8663 (diff) |
Merge branch 'remove-srcsrc-local-cache' into 'master'
Remove srcset and sizes attributes from img tag if locally caching images.
As discussed in <https://tt-rss.org/forum/viewtopic.php?f=1&t=3624#p21886>
See merge request !27
Diffstat (limited to 'include/functions2.php')
-rw-r--r--[-rwxr-xr-x] | include/functions2.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/functions2.php b/include/functions2.php index 7c714f564..ed22a0623 100755..100644 --- a/include/functions2.php +++ b/include/functions2.php @@ -912,6 +912,14 @@ if (file_exists($cached_filename)) { $src = SELF_URL_PATH . '/public.php?op=cached_image&hash=' . sha1($src); + + if ($entry->hasAttribute('srcset')) { + $entry->removeAttribute('srcset'); + } + + if ($entry->hasAttribute('sizes')) { + $entry->removeAttribute('sizes'); + } } $entry->setAttribute('src', $src); |