You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At line 373 of ImageHelper.php, this logic is consequently incorrect/inadequate:
if ( false === strpos($upload_dir['baseurl'], site_url()) ) {
// use HOME_URL and relative image path
$tmp = get_home_url().$tmp;
}
The assumption is made here, that if strpos returns false, it must mean a relative url was given, but that's not the case with Bedrock! Concatenating $tmp with get_home_url() for me therefore incorrectly returns:
I've encountered a bug in TimberImage's conversion of
src
to a path.I'm using Bedrock, which is a little "creative" about where things live in the file structure and what they're named.
My
wp_upload_dir()
function call returns this:At line 373 of
ImageHelper.php
, this logic is consequently incorrect/inadequate:The assumption is made here, that if
strpos
returns false, it must mean a relative url was given, but that's not the case with Bedrock! Concatenating$tmp
withget_home_url()
for me therefore incorrectly returns:http://day3-io.local/http://day3-io.local/app/uploads/.../path/to/my/image.jpg
I managed to resolve this by stripping out the
site_url()
from the src, before passing it to theresize()
filter, but that's only good for now.I haven't got time to work out a fix, so I'll leave that to someone else for now!
Cheers.
A
The text was updated successfully, but these errors were encountered: