fix #72 - update to Kirby 4.5

This commit is contained in:
isUnknown 2025-01-07 16:59:31 +01:00
parent cb1f842fc9
commit 44d08b3e21
273 changed files with 678 additions and 54176 deletions

View file

@ -96,8 +96,6 @@ class Collection extends Iterator implements Countable
* Low-level setter for elements
*
* @param string $key string or array
* @param mixed $value
* @return void
*/
public function __set(string $key, $value): void
{

View file

@ -102,4 +102,12 @@ class Obj extends stdClass
{
return json_encode($this->toArray(), ...$arguments);
}
/**
* Returns the property names as keys
*/
public function toKeys(): array
{
return array_keys((array)$this);
}
}

View file

@ -1132,7 +1132,7 @@ class Str
string $string = null,
string $separator = null,
string $allowed = null,
int $maxlength = 128
int|false $maxlength = 128
): string {
$separator ??= static::$defaults['slug']['separator'];
$allowed ??= static::$defaults['slug']['allowed'];
@ -1165,7 +1165,11 @@ class Str
$string = preg_replace('![^a-z0-9]+$!', '', $string);
// cut the string after the given maxlength
return static::short($string, $maxlength, '');
if ($maxlength !== false) {
$string = static::short($string, $maxlength, '');
}
return $string;
}
/**