diff --git a/include/functions.php b/include/functions.php index b824aa4c9..5ebd4e0ff 100755 --- a/include/functions.php +++ b/include/functions.php @@ -1528,7 +1528,7 @@ $doc->loadHTML($charset_hack . $res); $xpath = new DOMXPath($doc); - $entries = $xpath->query('(//img[@src]|//video[@poster]|//video/source[@src]|//audio/source[@src])'); + $entries = $xpath->query('(//img[@src]|//picture/source[@src]|//video[@poster]|//video/source[@src]|//audio/source[@src])'); $need_saving = false; @@ -1545,6 +1545,8 @@ // this is strictly cosmetic if ($entry->tagName == 'img') { $suffix = ".png"; + } else if ($entry->parentNode && $entry->parentNode->tagName == "picture") { + $suffix = ".png"; } else if ($entry->parentNode && $entry->parentNode->tagName == "video") { $suffix = ".mp4"; } else if ($entry->parentNode && $entry->parentNode->tagName == "audio") { @@ -1592,7 +1594,7 @@ $rewrite_base_url = $site_url ? $site_url : get_self_url_prefix(); - $entries = $xpath->query('(//a[@href]|//img[@src]|//video/source[@src]|//audio/source[@src])'); + $entries = $xpath->query('(//a[@href]|//img[@src]|//video/source[@src]|//audio/source[@src]|//picture/source[@src])'); foreach ($entries as $entry) { @@ -1686,7 +1688,7 @@ 'dt', 'em', 'footer', 'figure', 'figcaption', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'html', 'i', 'img', 'ins', 'kbd', 'li', 'main', 'mark', 'nav', 'noscript', - 'ol', 'p', 'pre', 'q', 'ruby', 'rp', 'rt', 's', 'samp', 'section', + 'ol', 'p', 'picture', 'pre', 'q', 'ruby', 'rp', 'rt', 's', 'samp', 'section', 'small', 'source', 'span', 'strike', 'strong', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'wbr', 'video', 'xml:namespace' ); diff --git a/plugins/af_zz_imgproxy/init.php b/plugins/af_zz_imgproxy/init.php index 7947d4ca2..2cd8fcaf0 100755 --- a/plugins/af_zz_imgproxy/init.php +++ b/plugins/af_zz_imgproxy/init.php @@ -170,7 +170,7 @@ class Af_Zz_ImgProxy extends Plugin { } } - $vids = $xpath->query("//video"); + $vids = $xpath->query("(//video|//picture)"); foreach ($vids as $vid) { if ($vid->hasAttribute("poster")) {