fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [11542] booking: break infinite loop


From: Sigurd Nes
Subject: [Fmsystem-commits] [11542] booking: break infinite loop
Date: Tue, 17 Dec 2013 15:17:58 +0000

Revision: 11542
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11542
Author:   sigurdne
Date:     2013-12-17 15:17:58 +0000 (Tue, 17 Dec 2013)
Log Message:
-----------
booking: break infinite loop

Modified Paths:
--------------
    trunk/booking/inc/class.bobooking.inc.php

Modified: trunk/booking/inc/class.bobooking.inc.php
===================================================================
--- trunk/booking/inc/class.bobooking.inc.php   2013-12-17 13:45:05 UTC (rev 
11541)
+++ trunk/booking/inc/class.bobooking.inc.php   2013-12-17 15:17:58 UTC (rev 
11542)
@@ -401,8 +401,17 @@
                                                // We need to use 24:00 instead 
of 00:00 to sort correctly
                                                $new_booking['to_'] = 
$new_booking['to_'] == '00:00' ? '24:00' : $new_booking['to_'];
                                                $new_bookings[] = $new_booking;
+
                                                if($date->format('Y-m-d') == 
$end->format('Y-m-d'))
+                                               {
                                                        break;
+                                               }
+
+                                               if($date->getTimestamp() > 
$end->getTimestamp())
+                                               {
+                                                       throw new 
InvalidArgumentException('start time( ' . $date->format('Y-m-d') . ' ) later 
than end time( ' . $end->format('Y-m-d') . " ) for 
{$booking['type']}#{$booking['id']}::{$booking['name']}");
+                                               }
+
                                                $date->modify('+1 day');
                                        }
                                        while(true);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]