From f3974efb6b15da54d682e3c9d274b406cbd40406 Mon Sep 17 00:00:00 2001 From: Gerhard Potgieter Date: Wed, 14 Feb 2018 11:35:16 +0200 Subject: [PATCH] Fetch size dynamically --- includes/class-wc-product-download.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-product-download.php b/includes/class-wc-product-download.php index af7c08a1246..2dd49f7ee37 100644 --- a/includes/class-wc-product-download.php +++ b/includes/class-wc-product-download.php @@ -96,7 +96,7 @@ class WC_Product_Download implements ArrayAccess { $file_url = $this->get_file(); if ( '..' === substr( $file_url, 0, 2 ) || '/' !== substr( $file_url, 0, 1 ) ) { $file_url = realpath( ABSPATH . $file_url ); - } elseif ( substr( WP_CONTENT_DIR, strlen( untrailingslashit( ABSPATH ) ) ) === substr( $file_url, 0, 11 ) ) { + } elseif ( substr( WP_CONTENT_DIR, strlen( untrailingslashit( ABSPATH ) ) ) === substr( $file_url, 0, strlen( substr( WP_CONTENT_DIR, strlen( untrailingslashit( ABSPATH ) ) ) ) ) ) { $file_url = realpath( WP_CONTENT_DIR . substr( $file_url, 11 ) ); } return apply_filters( 'woocommerce_downloadable_file_exists', file_exists( $file_url ), $this->get_file() );