mirror of
https://github.com/pronamic/woocommerce-subscriptions.git
synced 2025-10-16 14:22:56 +00:00
2.3.7
This commit is contained in:

committed by
Remco Tolsma

parent
a3be3724dc
commit
ce24e61a4c
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user