PluginProbe
Redirection / 2.3.8
Redirection v2.3.8
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.3.8, at actions/pass.php

48 lines 1006 B
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 {
5 function process_before ($code, $target)
6 {
7 // Determine what we are passing to: local URL, remote URL, file
8 if (substr ($target, 0, 7) == 'http://' || substr ($target, 0, 8) == 'https://') {
9 echo @wp_remote_fopen ($target);
10 die();
11 }
12 else if (substr ($target, 0, 7) == 'file://')
13 {
14 $parts = explode ('?', substr ($target, 7));
15 if (count ($parts) > 1)
16 {
17 // Put parameters into the environment
18 $args = explode ('&', $parts[1]);
19 if (count ($args) > 0)
20 {
21 foreach ($args AS $arg)
22 {
23 $tmp = explode ('=', $arg);
24 if (count ($tmp) == 1)
25 $_GET[$arg] = '';
26 else
27 $_GET[$tmp[0]] = $tmp[1];
28 }
29 }
30 }
31
32 include ($parts[0]);
33 exit ();
34 }
35 else
36 {
37 $_SERVER['REQUEST_URI'] = $target;
38 if (strpos ($target, '?'))
39 {
40 $_SERVER['QUERY_STRING'] = substr ($target, strpos ($target, '?') + 1);
41 parse_str ($_SERVER['QUERY_STRING'], $_GET);
42 }
43 }
44
45 return true;
46 }
47 }
48