From 4918d7a27d3db147790dad62f9a32df290fdc029 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 1 Mar 2013 20:58:25 +0000 Subject: [PATCH] Billing email must be set to grant permission. #2555 --- admin/post-types/writepanels/writepanel-order_downloads.php | 2 +- woocommerce-ajax.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/admin/post-types/writepanels/writepanel-order_downloads.php b/admin/post-types/writepanels/writepanel-order_downloads.php index ba0d3c36e8f..d79987712d4 100644 --- a/admin/post-types/writepanels/writepanel-order_downloads.php +++ b/admin/post-types/writepanels/writepanel-order_downloads.php @@ -122,7 +122,7 @@ function woocommerce_order_downloads_meta_box() { } else { - alert(''); + alert(''); } diff --git a/woocommerce-ajax.php b/woocommerce-ajax.php index c34957e8d19..4f516028170 100644 --- a/woocommerce-ajax.php +++ b/woocommerce-ajax.php @@ -875,6 +875,9 @@ function woocommerce_grant_access_to_download() { $user_email = sanitize_email( $order->billing_email ); + if ( ! $user_email ) + die(); + $limit = trim( get_post_meta( $product_id, '_download_limit', true ) ); $expiry = trim( get_post_meta( $product_id, '_download_expiry', true ) ); $file_paths = apply_filters( 'woocommerce_file_download_paths', get_post_meta( $product_id, '_file_paths', true ), $product_id, $order_id, null );