From c2b6398afe1e6629ff65748aed6d78c2e245bf6d Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Fri, 12 Mar 2010 18:32:11 +1300 Subject: [PATCH] Minor adjustments to handling 'infinity' for timeout. --- inc/caldav-MKTICKET.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/caldav-MKTICKET.php b/inc/caldav-MKTICKET.php index 8e97ea9b..ce75a911 100644 --- a/inc/caldav-MKTICKET.php +++ b/inc/caldav-MKTICKET.php @@ -64,13 +64,13 @@ foreach( $xmltree->GetContent() AS $k => $v ) { } } -if ( preg_match( '{^([a-z]+)-(\d+)$}i', $ticket_timeout, $matches ) ) { +if ( $ticket_timeout == 'infinity' ) { + $sql_timeout = null; +} +else if ( preg_match( '{^([a-z]+)-(\d+)$}i', $ticket_timeout, $matches ) ) { /** It isn't specified, but timeout seems to be 'unit-number' like 'Seconds-3600', so we make it '3600 Seconds' which PostgreSQL understands */ $sql_timeout = $matches[2] . ' ' . $matches[1]; } -else if ( $ticket_timeout == 'infinity' ) { - $sql_timeout = null; -} else { $sql_timeout = $ticket_timeout; }