Fix spaces in templates

This commit is contained in:
Jake Barnby 2025-08-27 01:40:32 +12:00
parent 28e7f12932
commit c9f9db722b
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -173,6 +173,6 @@ class Template extends View
*/
public static function fromCamelCaseToDash($input): string
{
return \strtolower(\preg_replace('/(?<!^)([A-Z][a-z]|(?<=[a-z])[^a-z\s]|(?<=[A-Z])[0-9_])/', '-$1', $input));
return \str_replace([' ', '_'], '', \strtolower(\preg_replace('/(?<!^)([A-Z][a-z]|(?<=[a-z])[^a-z\s]|(?<=[A-Z])[0-9_])/', '-$1', $input)));
}
}