Plugin bug: does not respect URL port
-
I’ve found a bug in the extension. I run my blog locally on the following URL:
http://my-test-site:8080/I noticed the webp plugin was rewriting my images incorrectly, all webp images did not have the correct base URL (missing port from the URL) e.g.
<picture><source srcset=”http://my-test-site/wp-content/uploads/2019/10/campaign-test-2000-1-700×525.webp 700w, http://my-test-site/wp-content/uploads/2019/10/campaign-test-2000-1-1000×750.webp 1000w” sizes=”(max-width: 700px) 100vw, 700px” type=”image/webp”>
</picture>When i traced it down, the error is on this line (199) of AlterHtmlHelper.php:
As you can see, the port is lost when you build up the URL here:
return $sourceUrlComponents[‘scheme’] . ‘://’ . $sourceUrlComponents[‘host’] . $destUrlComponents[‘path’];You need to take the port into consideration. Do you think you could update the plugin with a quick two liner fix?
The topic ‘Plugin bug: does not respect URL port’ is closed to new replies.