Upgrade to 4.4.0
This commit is contained in:
9
kirby/vendor/symfony/yaml/Inline.php
vendored
9
kirby/vendor/symfony/yaml/Inline.php
vendored
@@ -709,8 +709,13 @@ class Inline
|
||||
case Parser::preg_match('/^(-|\+)?[0-9][0-9_]*(\.[0-9_]+)?$/', $scalar):
|
||||
return (float) str_replace('_', '', $scalar);
|
||||
case Parser::preg_match(self::getTimestampRegex(), $scalar):
|
||||
// When no timezone is provided in the parsed date, YAML spec says we must assume UTC.
|
||||
$time = new \DateTimeImmutable($scalar, new \DateTimeZone('UTC'));
|
||||
try {
|
||||
// When no timezone is provided in the parsed date, YAML spec says we must assume UTC.
|
||||
$time = new \DateTimeImmutable($scalar, new \DateTimeZone('UTC'));
|
||||
} catch (\Exception $e) {
|
||||
// Some dates accepted by the regex are not valid dates.
|
||||
throw new ParseException(\sprintf('The date "%s" could not be parsed as it is an invalid date.', $scalar), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename, $e);
|
||||
}
|
||||
|
||||
if (Yaml::PARSE_DATETIME & $flags) {
|
||||
return $time;
|
||||
|
Reference in New Issue
Block a user