This commit is contained in:
Prospress Inc
2018-09-28 16:11:56 +02:00
committed by Remco Tolsma
parent a3be3724dc
commit ce24e61a4c
44 changed files with 526 additions and 357 deletions

View File

@@ -608,7 +608,7 @@ function wcs_is_datetime_mysql_format( $time ) {
}
if ( function_exists( 'strptime' ) ) {
$valid_time = $match = ( false !== strptime( $time, '%Y-%m-%d %H:%M:%S' ) ) ? true : false;
$valid_time = $match = ( false !== strptime( $time, '%Y-%m-%d %H:%M:%S' ) );
} else {
// parses for the pattern of YYYY-MM-DD HH:MM:SS, but won't check whether it's a valid timedate
$match = preg_match( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $time );
@@ -618,7 +618,7 @@ function wcs_is_datetime_mysql_format( $time ) {
}
// magic number -2209078800 is strtotime( '1900-01-00 00:00:00' ). Needed to achieve parity with strptime
return ( $match && false !== $valid_time && -2209078800 <= $valid_time ) ? true : false;
return $match && false !== $valid_time && -2209078800 <= $valid_time;
}
/**