From 05e13c7827a124d9814e755db2b665c412089730 Mon Sep 17 00:00:00 2001 From: Dimitris Gerasopoulos Date: Fri, 1 Oct 2021 10:05:29 +0200 Subject: [PATCH] Fix escaping issue --- attributes/pure_multiple_files/form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attributes/pure_multiple_files/form.php b/attributes/pure_multiple_files/form.php index 50f8770..b59eb38 100644 --- a/attributes/pure_multiple_files/form.php +++ b/attributes/pure_multiple_files/form.php @@ -45,7 +45,7 @@ if (is_array($currentFiles)) { foreach ($currentFiles as $index => $file) { $fv = $file->getRecentVersion(); - echo '{fID:'.$fv->getFileID().',filename:\''.$fv->getTitle().'\',thumbnailIMG:\''.$fv->getListingThumbnailImage().'\'}'; + echo '{fID:'.$fv->getFileID().',filename:'.json_encode($fv->getTitle()).',thumbnailIMG:'.json_encode($fv->getListingThumbnailImage()).'}'; if ($index < count($currentFiles) - 1) { echo ','; } @@ -54,4 +54,4 @@ ?>]; MultipleFilesAttribute.init(akID, multipleFilesCurrentSelected, max_count, token); }); - \ No newline at end of file +