Merge pull request #1092 from webbuilders-group/fix-templates-regex-windows

BUGFIX: Fixed issue causing the regex on windows to throw an error
This commit is contained in:
Daniel Hensby 2021-07-28 22:55:41 +01:00 committed by GitHub
commit 22f45d069a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -542,7 +542,7 @@ class EmailRecipient extends DataObject
$templatePath = substr($absoluteFilename, strlen($prefixToStrip) + 1); $templatePath = substr($absoluteFilename, strlen($prefixToStrip) + 1);
// Optionally remove "templates/" ("templates\" on Windows respectively) prefixes // 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]; $templatePath = $matches[0];
} }