| @@ -4,11 +4,8 @@ | ||
| 4 | 4 | public function process_external( $url ) { |
| 5 | 5 | echo @wp_remote_fopen( $url ); |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | - /** | |
| 9 | - * This is deprecated and will be removed in a future version | |
| 10 | - */ | |
| 11 | 8 | public function process_file( $url ) { |
| 12 | 9 | $parts = explode( '?', substr( $url, 7 ) ); |
| 13 | 10 | |
| 14 | 11 | if ( count( $parts ) > 1 ) { |
| @@ -46,13 +43,27 @@ | ||
| 46 | 43 | public function is_external( $target ) { |
| 47 | 44 | return substr( $target, 0, 7 ) === 'http://' || substr( $target, 0, 8 ) === 'https://'; |
| 48 | 45 | } |
| 49 | 46 | |
| 47 | + public function is_file( $target ) { | |
| 48 | + return substr( $target, 0, 7 ) === 'file://'; | |
| 49 | + } | |
| 50 | + | |
| 50 | 51 | public function process_before( $code, $target ) { |
| 51 | 52 | // External target |
| 52 | 53 | if ( $this->is_external( $target ) ) { |
| 53 | 54 | $this->process_external( $target ); |
| 54 | 55 | exit(); |
| 56 | + } | |
| 57 | + | |
| 58 | + // file:// targetw | |
| 59 | + if ( $this->is_file( $target ) ) { | |
| 60 | + if ( defined( 'REDIRECTION_SUPPORT_PASS_FILE' ) && REDIRECTION_SUPPORT_PASS_FILE ) { | |
| 61 | + $this->process_file( $target ); | |
| 62 | + exit(); | |
| 63 | + } | |
| 64 | + | |
| 65 | + return; | |
| 55 | 66 | } |
| 56 | 67 | |
| 57 | 68 | return $this->process_internal( $target ); |
| 58 | 69 | } |