Revert "Enable redirect method to also handle absolute filepaths."
This reverts commit 36022c29eb
.
This commit is contained in:
parent
df26e72ddf
commit
d54cd10bb4
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue