Upgrade to 4.0.0

This commit is contained in:
Bastian Allgeier
2023-11-28 09:33:56 +01:00
parent f96b96af76
commit 3b0b6546ca
480 changed files with 21371 additions and 13327 deletions

View File

@@ -4,7 +4,7 @@ namespace Kirby\Toolkit;
use Countable;
use Exception;
use Kirby\Cms\Field;
use Kirby\Content\Field;
use Kirby\Exception\InvalidArgumentException;
use Kirby\Http\Idn;
use Kirby\Uuid\Uuid;
@@ -449,7 +449,7 @@ V::$validators = [
* Checks if the value matches the given regular expression
*/
'match' => function ($value, string $pattern): bool {
return preg_match($pattern, $value) !== 0;
return preg_match($pattern, (string)$value) === 1;
},
/**
@@ -596,6 +596,13 @@ V::$validators = [
return Str::startsWith($value, $start);
},
/**
* Checks for a valid unformatted telephone number
*/
'tel' => function ($value): bool {
return V::match($value, '!^[+]{0,1}[0-9]+$!');
},
/**
* Checks for valid time
*/