PluginProbe
Redirection / 2.7
Redirection v2.7
5.10.0 5.9.0 5.8.1 5.8.0 3.7.2 3.7.3 4.0 4.0.1 4.1 4.1.1 4.2 4.2.1 4.2.2 4.2.3 4.3 4.3.1 4.3.2 4.3.3 4.4 4.4.1 4.4.2 4.5 4.5.1 4.6.2 4.7.1 All 130 releases
redirection / actions / pass.php

pass.php in Redirection 2.7, at actions/pass.php

41 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class Pass_Action extends Red_Action {
4 function process_before( $code, $target ) {
5 // Determine what we are passing to: local URL, remote URL, file
6 if ( substr( $target, 0, 7 ) === 'http://' || substr( $target, 0, 8 ) === 'https://' ) {
7 echo @wp_remote_fopen( $target );
8 die();
9 }
10 else if ( substr( $target, 0, 7 ) === 'file://' ) {
11 $parts = explode( '?', substr( $target, 7 ) );
12 if ( count( $parts ) > 1 ) {
13 // Put parameters into the environment
14 $args = explode( '&', $parts[1] );
15
16 if ( count( $args ) > 0 ) {
17 foreach ( $args as $arg ) {
18 $tmp = explode( '=', $arg );
19 if ( count( $tmp ) === 1 )
20 $_GET[ $arg ] = '';
21 else
22 $_GET[ $tmp[0] ] = $tmp[1];
23 }
24 }
25 }
26
27 include( $parts[0] );
28 exit();
29 }
30 else {
31 $_SERVER['REQUEST_URI'] = $target;
32 if ( strpos( $target, '?' ) ) {
33 $_SERVER['QUERY_STRING'] = substr( $target, strpos( $target, '?' ) + 1 );
34 parse_str( $_SERVER['QUERY_STRING'], $_GET );
35 }
36 }
37
38 return true;
39 }
40 }
41