Merge pull request #1041 from chrometoasters/pulls/1039-email-template-path-win-fix

Use correct directory separator on Windows when selecting email templates
This commit is contained in:
Steve Boyd 2021-02-21 21:50:33 +13:00 committed by GitHub
commit 75fe398be5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -521,8 +521,8 @@ class EmailRecipient extends DataObject
} }
$templatePath = substr($absoluteFilename, strlen($prefixToStrip) + 1); $templatePath = substr($absoluteFilename, strlen($prefixToStrip) + 1);
// Optionally remove "templates/" prefixes // Optionally remove "templates/" ("templates\" on Windows respectively) prefixes
if (preg_match('/(?<=templates\/).*$/', $templatePath, $matches)) { if (preg_match('#(?<=templates' . DIRECTORY_SEPARATOR . ').*$#', $templatePath, $matches)) {
$templatePath = $matches[0]; $templatePath = $matches[0];
} }