allow negative duration via internal API (#3573)
This commit is contained in:
@@ -21,11 +21,12 @@ class Duration extends Regex
|
||||
{
|
||||
$patterns = [
|
||||
// decimal times (can be separated by comma or dot, depending on the locale)
|
||||
'[0-9]{1,}',
|
||||
'[0-9]{1,}[,.]{1}[0-9]{1,}',
|
||||
// negative times -? are allowed, because plugins could allow negative times
|
||||
'-?[0-9]{1,}',
|
||||
'-?[0-9]{1,}[,.]{1}[0-9]{1,}',
|
||||
// ASP.NET style time spans - https://momentjs.com/docs/#/durations/
|
||||
'[0-9]{1,}:[0-9]{1,}:[0-9]{1,}',
|
||||
'[0-9]{1,}:[0-9]{1,}',
|
||||
'-?[0-9]{1,}:[0-9]{1,}:[0-9]{1,}',
|
||||
'-?[0-9]{1,}:[0-9]{1,}',
|
||||
// https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
|
||||
'[0-9]{1,}[hHmMsS]{1}',
|
||||
'[0-9]{1,}[hH]{1}[0-9]{1,}[mM]{1}',
|
||||
|
||||
Reference in New Issue
Block a user