From ed8afe992c7709b03e84217673522d4d62632c13 Mon Sep 17 00:00:00 2001 From: Coen Jacobs Date: Wed, 9 May 2012 22:19:46 +0200 Subject: [PATCH] Prevent setting download expire date to 1970-01-01 in rare cases. Closes #1013 --- admin/post-types/writepanels/writepanel-order_downloads.php | 2 +- readme.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/admin/post-types/writepanels/writepanel-order_downloads.php b/admin/post-types/writepanels/writepanel-order_downloads.php index ba0008fab4b..45f6178877a 100644 --- a/admin/post-types/writepanels/writepanel-order_downloads.php +++ b/admin/post-types/writepanels/writepanel-order_downloads.php @@ -268,7 +268,7 @@ function woocommerce_order_downloads_save( $post_id, $post ) { $format = array( '%d', '%s', '%s'); - $expiry = array_key_exists($i, $access_expires) ? date('Y-m-d', strtotime($access_expires[$i])) : null; + $expiry = ( array_key_exists( $i, $access_expires ) && $access_expires[ $i ] != '' ) ? date( 'Y-m-d', strtotime( $access_expires[ $i ] ) ) : null; if ( ! is_null($expiry)) { $data['access_expires'] = $expiry; diff --git a/readme.txt b/readme.txt index e20bc1dadfb..43e854d9c2f 100644 --- a/readme.txt +++ b/readme.txt @@ -186,6 +186,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc * Fix - per product flat rate. * Fix - Use term_id instead of term slug to get term link (allows numeric slugs for product categories) * Fix - Replace spaces with + signs in download url after decode (allows + characters in email addresses for downloads) +* Fix - Prevent setting download expire date to 1970-01-01 in rare cases * Localization - Slovak translation by Dušan Beleščák * Localization - Updated localisations * Localization - Updated French translation by mediana (Ticket 1000 in GitHub, woohoo!)