Prevent setting download expire date to 1970-01-01 in rare cases. Closes #1013

This commit is contained in:
Coen Jacobs 2012-05-09 22:19:46 +02:00
parent 6c3bf05433
commit ed8afe992c
2 changed files with 2 additions and 1 deletions

View File

@ -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;

View File

@ -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!)