X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhtmlform%2Ffields%2FHTMLDateTimeField.php;h=3390a56771acdf892cbda08e4375de10190756e0;hb=627148d2bbf56a2645d3b5753e25b6d81009f3e1;hp=66f89f95642b78d9c649a21a7de868bcafde8532;hpb=48df0714bbfe0d5cf3ced3de9081c02d583d78c3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/fields/HTMLDateTimeField.php b/includes/htmlform/fields/HTMLDateTimeField.php index 66f89f9564..3390a56771 100644 --- a/includes/htmlform/fields/HTMLDateTimeField.php +++ b/includes/htmlform/fields/HTMLDateTimeField.php @@ -126,6 +126,9 @@ class HTMLDateTimeField extends HTMLTextField { protected function parseDate( $value ) { $value = trim( $value ); + if ( $value === '' ) { + return false; + } if ( $this->mType === 'date' ) { $value .= ' T00:00:00+0000'; @@ -138,7 +141,7 @@ class HTMLDateTimeField extends HTMLTextField { $date = new DateTime( $value, new DateTimeZone( 'GMT' ) ); return $date->getTimestamp(); } catch ( Exception $ex ) { - return 0; + return false; } }