Open matdave opened 11 months ago
Thank you! Since I can't test this here, I'll have to rely on your suggestion. Does this touch any other media source types?
I don't think that the regex is right in your patch. It trims multiple baseUrls on the left from the src. This is maybe right, if the baseUrl value of the mediasource contains only a slash, but not if it contains i.e. slashes and a cultureKey.
Can you give an example for the input and the result? Is it ok to trim only a single value?
It may be wrong. It's just what I threw on a site to make it work :rofl:. Example on the site was the src returns https://s3.site.com/path/to/image.jpg. and it was outputting https://s3.site.com/https://s3.site.com/path/to/image.jpg with ImagePlus
I had a similar issue on the new BannerX fork, and solved it on the PHP side here:
3.x https://github.com/matdave/BannerRevised/blob/c8ff8dd032d69ffd478990b5b07fd10b676236fd/core/components/bannerrevised/src/Model/Ad.php#L28 2.x https://github.com/matdave/BannerRevised/blob/c8ff8dd032d69ffd478990b5b07fd10b676236fd/core/components/bannerrevised/model/bannerrevised/brevad.class.php#L5
I've added a trim statement to the URL to help with external image sources. These return with the base URL prepended when grabbed from the media browser.