From d6b0e71d455884ef6546421a20b7deea95c64825 Mon Sep 17 00:00:00 2001 From: ReeceM Date: Fri, 3 Dec 2021 21:40:21 +0200 Subject: [PATCH 1/2] refactoring missing params method --- src/MailEclipse.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/MailEclipse.php b/src/MailEclipse.php index 0244bc4..0b1ba03 100644 --- a/src/MailEclipse.php +++ b/src/MailEclipse.php @@ -654,12 +654,12 @@ private static function getMissingParams($arg, $params) } $type = version_compare(phpversion(), '7.1', '>=') - ? self::TYPES[$reflection->getName()] - : self::TYPES[/** @scrutinizer ignore-deprecated */ $reflection->__toString()]; + ? $reflection->getName() + : /** @scrutinizer ignore-deprecated */ $reflection->__toString(); - return is_null($type) - ? new Mocked($arg, \ReeceM\Mocker\Utils\VarStore::singleton()) - : $type; + return array_key_exists($type, self::TYPES) + ? self::TYPES[$type] + : new Mocked($arg, \ReeceM\Mocker\Utils\VarStore::singleton()); } catch (\Exception $e) { return $arg; } From 00b664daa84193be23253c118086f61ebdbb5b1c Mon Sep 17 00:00:00 2001 From: ReeceM Date: Fri, 3 Dec 2021 21:40:51 +0200 Subject: [PATCH 2/2] fix: capture all variations of the new line char --- .../sections/edit-mailable-template.blade.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/resources/views/sections/edit-mailable-template.blade.php b/resources/views/sections/edit-mailable-template.blade.php index 6ca8bba..0115043 100644 --- a/resources/views/sections/edit-mailable-template.blade.php +++ b/resources/views/sections/edit-mailable-template.blade.php @@ -341,10 +341,14 @@ className: "fa fa-eye no-disable", placeholder: "Write your Beautiful Email", previewRender: function(plainText, preview) { $.ajax({ - method: "POST", - url: "{{ route('previewMarkdownView') }}", - data: { markdown: plainText, namespace: '{{ addslashes($templateData['namespace']) }}', viewdata: "{{ preg_replace("/\r\n/","
", serialize($templateData['view_data'])) }}", name: '{{ $name }}' } - + method: "POST", + url: "{{ route('previewMarkdownView') }}", + data: { + markdown: plainText, + namespace: '{{ addslashes($templateData['namespace']) }}', + viewdata: "{{ preg_replace("/[\r\n]/","
", serialize($templateData['view_data'])) }}", + name: '{{ $name }}' + } }).done(function( HtmledTemplate ) { preview.innerHTML = HtmledTemplate; }); @@ -496,7 +500,7 @@ function viewMarkdownParser(plainText){ data: { markdown: plainText, namespace: '{{ addslashes($templateData['namespace']) }}', - viewdata: "{{ preg_replace("/\r\n/","
", serialize($templateData['view_data'])) }}", + viewdata: "{{ preg_replace("/[\r\n]/","
", serialize($templateData['view_data'])) }}", name: '{{ $name }}' }