skip to Main Content

SVG from PHP script is not working in img src

I'm trying to open SVG file first in PHP and then return this data: $file = dirname(__FILE__) . $_GET["file"] . ".svg"; if (!file_exists($file)) { $file = dirname(__FILE__) . $_GET["file"] . ".png"; if (!file_exists($file)) { throw new NotFoundHttpException(); } else header('Content-Type:…

VIEW QUESTION

WordPress some img src are replaced with `data:image/svg+xml…`

I created a custom page template in one of my site's theme. Some img src were rendered correctly, but some were replaced with something like data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%200%200'%3E%3C/svg%3E to be exact, it looked like this in live site: <img src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%200%200'%3E%3C/svg%3E" alt="" data-lazy-src="https://example.com/wp-content/themes/MyTheme/img/icons/Info.png"…

VIEW QUESTION
Back To Top
Search