yireo / Yireo_NextGenImages

44 stars 26 forks source link

Check Media URL instead of regular Base URL #9

Closed barryvdh closed 3 years ago

barryvdh commented 3 years ago

The check introduced in https://github.com/yireo/Yireo_NextGenImages/pull/6 checks the BaseURL. When the Store Code is added to the URL (en /nl) the url doesn't match. By requesting the Media URL, the url does match.

tdgroot commented 3 years ago

@barryvdh this looks good to me! 👍

barryvdh commented 3 years ago

As said in https://github.com/yireo/Yireo_NextGenImages/issues/8 we might need to check both urls.

jissereitsma commented 3 years ago

Thanks for this. However, I'm going to skip merging. With this check for the media URL, I found the code to be a bit chaotic: An HtmlReplacer class was responsible for converting URLs to filenames? So this lead to the introduction of a new class https://github.com/yireo/Yireo_NextGenImages/blob/master/Image/UrlConvertor.php#L81 that should have the same outcome.

Could you test if 0.2.5 works for you?