ENH Provide hook for updating the parent used for absoluteURL (#10168)

One use case for this that I've run into a few times is for sending emails using a queued job from the CLI.
This commit is contained in:
GuySartorelli 2022-01-31 20:41:14 +13:00 committed by GitHub
parent 83156dd9c9
commit fc2160fa3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -470,6 +470,7 @@ class Director implements TemplateGlobalProvider
// Default to respecting site base_url
$parent = self::absoluteBaseURL();
}
static::singleton()->extend('updateAbsoluteURLParent', $parent);
// Map empty urls to relative slash and join to base
if (empty($url) || $url === '.' || $url === './') {