From b379ccd21c870191d87f58472f17e1a2aebf99ab Mon Sep 17 00:00:00 2001 From: Yassine Date: Tue, 26 Mar 2019 13:45:15 +0100 Subject: [PATCH] replace absolute viewpath to encoded plain text --- resources/views/sections/edit-mailable-template.blade.php | 8 ++++---- src/Http/Controllers/MailablesController.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/views/sections/edit-mailable-template.blade.php b/resources/views/sections/edit-mailable-template.blade.php index 45cd8f9..238e52c 100644 --- a/resources/views/sections/edit-mailable-template.blade.php +++ b/resources/views/sections/edit-mailable-template.blade.php @@ -378,13 +378,13 @@ function setTableComponent(editor) { if (typeof plaintextEditor !== 'undefined' && plaintextEditor.getValue() !== ''){ axios.post('{{ route('parseTemplate') }}', { markdown: plaintextEditor.getValue(), - viewpath: "{{ $templateData['text_view_path'] }}" + viewpath: "{{ base64_encode($templateData['text_view_path']) }}" }) } axios.post('{{ route('parseTemplate') }}', { markdown: simplemde.codemirror.getValue(), - viewpath: "{{ $templateData['view_path'] }}" + viewpath: "{{ base64_encode($templateData['view_path']) }}" }) .then(function (response) { @@ -502,13 +502,13 @@ function viewMarkdownParser(plainText){ if (typeof plaintextEditor !== 'undefined' && plaintextEditor.getValue() !== ''){ axios.post('{{ route('parseTemplate') }}', { markdown: plaintextEditor.getValue(), - viewpath: "{{ $templateData['text_view_path'] }}" + viewpath: "{{ base64_encode($templateData['text_view_path']) }}" }) } axios.post('{{ route('parseTemplate') }}', { markdown: tinymce.get('template_editor').getContent(), - viewpath: "{{ $templateData['view_path'] }}" + viewpath: "{{ base64_encode($templateData['view_path']) }}" }) .then(function (response) { diff --git a/src/Http/Controllers/MailablesController.php b/src/Http/Controllers/MailablesController.php index 4c04d57..8800eec 100644 --- a/src/Http/Controllers/MailablesController.php +++ b/src/Http/Controllers/MailablesController.php @@ -86,7 +86,7 @@ public function parseTemplate(Request $request) $template = $request->has('template') ? $request->template : false; - if( mailEclipse::markdownedTemplateToView(true, $request->markdown, $request->viewpath, $template) ){ + if( mailEclipse::markdownedTemplateToView(true, $request->markdown, base64_decode($request->viewpath), $template) ){ return response()->json([ 'status' => 'ok',