Revert "Enable redirect method to also handle absolute filepaths."

This reverts commit 36022c29eb.
This commit is contained in:
roykho 2021-09-23 18:51:10 -07:00
parent df26e72ddf
commit d54cd10bb4
No known key found for this signature in database
GPG Key ID: 7B36C0EA25795714
2 changed files with 3 additions and 5 deletions

View File

@ -241,11 +241,6 @@ class WC_Download_Handler {
* @param string $filename File name.
*/
public static function download_file_redirect( $file_path, $filename = '' ) {
$parsed_file_path = self::parse_file_path( $file_path );
$file_path = $parsed_file_path['file_path'];
if ( ! $parsed_file_path['remote_file'] ) {
$file_path = trim( preg_replace( '`^' . str_replace( '\\', '/', getcwd() ) . '`', '', $file_path ), '/' );
}
header( 'Location: ' . $file_path );
exit;
}

View File

@ -172,6 +172,9 @@ class WC_Product_Download implements ArrayAccess {
$value = $matches[1];
}
$parsed_file_path = WC_Download_Handler::parse_file_path( $value );
$value = $parsed_file_path['file_path'];
switch ( $this->get_type_of_file_path( $value ) ) {
case 'absolute':
$this->data['file'] = esc_url_raw( $value );