Skip to content

Commit

Permalink
Possible white space fix woocommerce#3012
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Apr 29, 2013
1 parent 72de000 commit 24c9f44
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion woocommerce-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ function woocommerce_download_product() {
$product_id = (int) urldecode($_GET['download_file']);
$order_key = urldecode( $_GET['order'] );
$email = sanitize_email( str_replace( ' ', '+', urldecode( $_GET['email'] ) ) );
$download_id = isset( $_GET['key'] ) ? urldecode( $_GET['key'] ) : ''; // backwards compatibility for existing download URLs
$download_id = isset( $_GET['key'] ) ? preg_replace( '/\s+/', ' ', urldecode( $_GET['key'] ) ) : '';
$_product = get_product( $product_id );
$file_download_method = apply_filters( 'woocommerce_file_download_method', get_option( 'woocommerce_file_download_method' ), $product_id );

Expand All @@ -950,6 +950,7 @@ function woocommerce_download_product() {
$order_key,
$product_id
);

if ( $download_id ) {
// backwards compatibility for existing download URLs
$query .= " AND download_id = %s";
Expand Down

0 comments on commit 24c9f44

Please sign in to comment.