woocommerce_use_xsendfile_for_remote

woocommerce_use_xsendfile_for_remote

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.3.3

apply_filters('woocommerce_use_xsendfile_for_remote') is found 1 times:

  • /includes/class-wc-download-handler.php line 358
    		 * Fallback on force download method for remote files. This is because:
    		 * 1. xsendfile needs proxy configuration to work for remote files, which cannot be assumed to be available on most hosts.
    		 * 2. Force download method is more secure than redirect method if `allow_url_fopen` is enabled in `php.ini`.
    		 */
    		if ( $parsed_file_path['remote_file'] && ! apply_filters( 'woocommerce_use_xsendfile_for_remote', false ) ) {
    			do_action( 'woocommerce_download_file_force', $file_path, $filename );
    			return;
    		}
    
    		if ( function_exists( 'apache_get_modules' ) && in_array( 'mod_xsendfile', apache_get_modules(), true ) ) {
    			self::download_headers( $parsed_file_path['file_path'], $filename );