You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think you're right. That's really overlooked bug. But I'm not sure if it will make a breaking change. We can also add a bool lowercase argument if we want, for convenience.
I agree that this is a bug as the method description really claims to work the same as PHP's ucfirst(). We should try to include it in v5, as it is a bugfix but could also seen as breaking change if anyone relied on this behavior.
kirby/src/Toolkit/Str.php
Lines 1387 to 1392 in 94cc37e
Description
The Str::ucfirst method in Kirby differs from PHP's native ucfirst() function.
PHP native
Converts only the first letter of the string to uppercase, leaving the rest of the string unchanged.
Kirby
Converts the first letter to uppercase and the rest of the string to lowercase.
Steps to Reproduce
Expected Behavior
Str::ucfirst should either align with PHP's ucfirst() or clarify its differing behavior in the documentation to avoid confusion.
Suggested Solutions
change
static::lower($rest)
to$rest
The text was updated successfully, but these errors were encountered: