Held duration must be > 0. Closes #2766.

This commit is contained in:
Mike Jolley 2013-03-22 20:36:36 +00:00
parent edb07efaef
commit 9c2a7afe8a
1 changed files with 1 additions and 1 deletions

View File

@ -2429,7 +2429,7 @@ function woocommerce_cancel_unpaid_orders() {
$held_duration = get_option( 'woocommerce_hold_stock_minutes' ); $held_duration = get_option( 'woocommerce_hold_stock_minutes' );
if ( $held_duration == '' || get_option( 'woocommerce_manage_stock' ) != 'yes' ) if ( $held_duration < 1 || get_option( 'woocommerce_manage_stock' ) != 'yes' )
return; return;
$date = date( "Y-m-d H:i:s", strtotime( '-' . absint( $held_duration ) . ' MINUTES', current_time( 'timestamp' ) ) ); $date = date( "Y-m-d H:i:s", strtotime( '-' . absint( $held_duration ) . ' MINUTES', current_time( 'timestamp' ) ) );