BUGFIX: vacation was set even when no date was entered
authorArun Persaud <arun@nubati.net>
Tue, 24 Feb 2009 05:36:36 +0000 (21:36 -0800)
committerArun Persaud <arun@nubati.net>
Tue, 24 Feb 2009 05:36:36 +0000 (21:36 -0800)
the vacation is set to the empty string in case nothing is entered, need to check for this.

include/preferences.php

index a319130da2bafab1392e85740c1c26ec3c04fdf5..f42ae82a19aa8385418bcba2c46fdbae47600f90 100644 (file)
@@ -33,7 +33,9 @@ DB_update_user_timestamp($myid);
  * update the database and track changes with a variable, so that
  * we can later highlight the changed value
  */
-if(myisset('vacation_start','vacation_stop','vacation_comment'))
+if(myisset('vacation_start','vacation_stop','vacation_comment') &&
+   ($_REQUEST['vacation_start']!='' || $_REQUEST['vacation_stop']!='')
+   )
   {
     $vacation_start   = $_REQUEST['vacation_start'].' 00:00:00';
     $vacation_stop    = $_REQUEST['vacation_stop'].' 23:59:59';