From 4e59133ceb37f41687098b2c157d41ca87eea419 Mon Sep 17 00:00:00 2001 From: guler Date: Thu, 20 Oct 2022 17:07:43 +0300 Subject: [PATCH 1/2] - Dont show upload path/url for security reaseon --- src/Form/Field/File.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Form/Field/File.php b/src/Form/Field/File.php index 3c0a9e8ae4..4073492c29 100644 --- a/src/Form/Field/File.php +++ b/src/Form/Field/File.php @@ -244,8 +244,14 @@ public function render() $this->setupDefaultOptions(); if (!empty($this->value)) { - $this->attribute('data-initial-preview', $this->preview()); - $this->attribute('data-initial-caption', $this->initialCaption($this->value)); + + /* + * Dont show upload path/url for security reaseon + */ + if(!$this->hidePreview()) { + $this->attribute('data-initial-preview', $this->preview()); + $this->attribute('data-initial-caption', $this->initialCaption($this->value)); + } $this->setupPreviewOptions(); /* From c8c2dc9b4e2737fd2905098e239ffce9808b9fbc Mon Sep 17 00:00:00 2001 From: guler Date: Fri, 28 Oct 2022 17:48:38 +0300 Subject: [PATCH 2/2] - Dont show upload path/url for security reaseon, fix --- src/Form/Field/File.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Form/Field/File.php b/src/Form/Field/File.php index 4073492c29..1cd0d55741 100644 --- a/src/Form/Field/File.php +++ b/src/Form/Field/File.php @@ -248,7 +248,7 @@ public function render() /* * Dont show upload path/url for security reaseon */ - if(!$this->hidePreview()) { + if (!$this->hidePreview()) { $this->attribute('data-initial-preview', $this->preview()); $this->attribute('data-initial-caption', $this->initialCaption($this->value)); }