Changed layout of amp images to responsive
authorMarcel Werk <burntime@woltlab.com>
Thu, 30 Jan 2020 14:10:54 +0000 (15:10 +0100)
committerMarcel Werk <burntime@woltlab.com>
Thu, 30 Jan 2020 14:10:54 +0000 (15:10 +0100)
wcfsetup/install/files/lib/system/html/output/AmpHtmlOutputProcessor.class.php

index 9749a63d30493c2b7cac91cefd89af21630c99b8..505ce590cdce561c3094e8e7e464e01c29051714 100644 (file)
@@ -117,7 +117,7 @@ class AmpHtmlOutputProcessor extends HtmlOutputProcessor {
                $html = preg_replace_callback('/<img([^>]+)>/i', function($match) {
                        $attributes = str_replace('data-width="', 'width="', $match[1]);
                        $attributes = str_replace('data-height="', 'height="', $attributes);
-                       return '<amp-img layout="flex-item"'.$attributes.'>';
+                       return '<amp-img layout="responsive"'.$attributes.'>';
                }, $html);
                
                $html = str_ireplace('<iframe', '<amp-iframe layout="responsive" width="480" height="300" sizes="(min-width: 480px) 480px, 100vw" ', $html);