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
This commit is contained in:
Andrew Dolgov 2016-02-19 09:39:11 +03:00
commit b501dc3c5a

8
include/functions2.php Executable file → Normal file
View file

@ -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);