mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-29 18:26:05 +00:00
Fix handling of iCalendar durations containing negative elements.
This commit is contained in:
parent
60fea594ae
commit
499313c9ca
@ -138,7 +138,7 @@ class RepeatRuleDateTime extends DateTime {
|
||||
|
||||
|
||||
public function modify( $interval ) {
|
||||
if ( preg_match('{^(-)?P((\d+)W)?((\d+)D)?T?((\d+)H)?((\d+)M)?((\d+)S)?$}', $interval, $matches) ) {
|
||||
if ( preg_match('{^(-)?P(([0-9-]+)W)?(([0-9-]+)D)?T?(([0-9-]+)H)?(([0-9-]+)M)?(([0-9-]+)S)?$}', $interval, $matches) ) {
|
||||
$minus = $matches[1];
|
||||
$interval = '';
|
||||
if ( isset($matches[2]) && $matches[2] != '' ) $interval .= $minus . $matches[3] . ' weeks ';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user