From daef0753a1b2aaca39d38ccd0c245986ba08af1e Mon Sep 17 00:00:00 2001 From: "csongor.bandi@lifeishard.ro" Date: Sun, 16 Nov 2025 17:24:07 +0200 Subject: [PATCH] Avoid invalid image request in Firefox caused by the template. --- resources/js/controllers/attach_controller.js | 6 +++++- resources/views/fields/attach.blade.php | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/resources/js/controllers/attach_controller.js b/resources/js/controllers/attach_controller.js index 47362a6a7..1b8b566c8 100644 --- a/resources/js/controllers/attach_controller.js +++ b/resources/js/controllers/attach_controller.js @@ -185,12 +185,16 @@ export default class extends ApplicationController { preview.querySelectorAll('*').forEach(element => { preview.innerHTML = preview.innerHTML .replace(/{id}/gi, attachment.id) - .replace(/{url}/gi, attachment.url) .replace(/{original_name}/gi, attachment.original_name) .replace(/{mime}/gi, attachment.mime) .replace(/{name}/gi, this.nameValue); }); + const attachImage = preview.querySelector('.attach-image'); + if (attachImage) { + attachImage.src = attachment.url; + } + if (replace !== null) { this.element.querySelector(`#attachment-${replace}`).outerHTML = pip.outerHTML; return; diff --git a/resources/views/fields/attach.blade.php b/resources/views/fields/attach.blade.php index 3c6f47596..b42a4b467 100644 --- a/resources/views/fields/attach.blade.php +++ b/resources/views/fields/attach.blade.php @@ -55,7 +55,10 @@ class="attach" - + Attached Image {{--