fix: require explicit CDN_ENABLED for CDN mode
All checks were successful
CI / PHP 8.3 (push) Successful in 2m34s
CI / PHP 8.4 (push) Successful in 2m2s

CDN no longer auto-enables via subdomain config. Requires
CDN_ENABLED=true in .env to prevent unexpected CDN URL generation.

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Snider 2026-03-02 17:38:25 +00:00
parent 096024d73c
commit 6b1aa5f4b7

View file

@ -52,14 +52,12 @@ class Cdn
/**
* Check if CDN mode is enabled.
*
* CDN is considered enabled if:
* - External CDN URL is configured, OR
* - CDN subdomain is configured (default)
* Requires explicit CDN_ENABLED=true in .env.
* Without it, all assets use the standard asset() helper.
*/
public static function isEnabled(): bool
{
return config('cdn.enabled', false)
|| config('core.cdn.subdomain');
return (bool) config('cdn.enabled', false);
}
/**