From 63a1d1deb2b659f1d1c752801e89b71dde5f615d Mon Sep 17 00:00:00 2001 From: UndefinedOffset Date: Mon, 19 Jul 2021 11:36:03 -0300 Subject: [PATCH] BUGFIX: Fixed issue causing the regex on windows to throw an error due to escaping of the parenthesis caused by DIRECTORY_SEPARATOR --- code/Model/Recipient/EmailRecipient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Model/Recipient/EmailRecipient.php b/code/Model/Recipient/EmailRecipient.php index e8e37e1..6a056d8 100644 --- a/code/Model/Recipient/EmailRecipient.php +++ b/code/Model/Recipient/EmailRecipient.php @@ -542,7 +542,7 @@ class EmailRecipient extends DataObject $templatePath = substr($absoluteFilename, strlen($prefixToStrip) + 1); // Optionally remove "templates/" ("templates\" on Windows respectively) prefixes - if (preg_match('#(?<=templates' . DIRECTORY_SEPARATOR . ').*$#', $templatePath, $matches)) { + if (preg_match('#(?<=templates' . preg_quote(DIRECTORY_SEPARATOR, '#') . ').*$#', $templatePath, $matches)) { $templatePath = $matches[0]; }