From 8f78836b69303dedff90c747ead063c234df83c2 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Wed, 13 Oct 2021 13:03:02 +0300 Subject: [PATCH] fixed image url --- .../default/visiosoft/advs-module/src/Adv/AdvRepository.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php index 54b48aff2..82c28a87d 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php @@ -319,7 +319,11 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface ), ); - $image = Image::make(file_get_contents($adv->files[0]->make()->url(), false, stream_context_create($arrContextOptions))); + $url = preg_replace_callback('#://([^/]+)/([^?]+)#', function ($match) { + return '://' . $match[1] . '/' . join('/', array_map('rawurlencode', explode('/', $match[2]))); + }, $adv->files[0]->make()->url()); + + $image = Image::make(file_get_contents($url, false, stream_context_create($arrContextOptions))); $image->resize( null, setting_value('visiosoft.module.advs::thumbnail_height'),