3 error_reporting(E_ALL);
7 // Copyright (C) 2001 The SourceForge ijbswa team.
8 // May be used under the GNU GPL, version 2 or later.
11 // Parse the v= and to= paramaters
12 function parse_parameters()
15 global $version_major, $version_minor, $version_point;
27 // Check if it's valid.
28 // Valid versions have the form "n.n.n", where n=digit(s).
29 if ( (strspn($v,"0123456789.") == strlen($v)) )
31 // Probably valid. Copy into globals.
32 $version_pieces = explode (".", $v, 4);
33 if (isset($version_pieces[0]))
35 $version_major = 0 + $version_pieces[0];
37 if (isset($version_pieces[1]))
39 $version_minor = 0 + $version_pieces[1];
41 if (isset($version_pieces[2]))
43 $version_point = 0 + $version_pieces[2];
50 // Trim whitespace and convert to lowercase.
51 $to = strtolower(trim($to));
53 // Restrict the characters in the string by removing everything
54 // from the first disallowed character onwards.
56 // Allowed characters are 0-9, a-z, ".", "_", "-".
58 $to = substr($to, 0, strspn($to, "0123456789abcdefghijklmnopqrstuvwxyz._-"));
69 // print "Version {$version_major}.{$version_minor}.{$version_point}<br>";
70 // print "Target \"{$to}\"<br>";
73 // Please do NOT delete any of these redirects. Even if you take them
74 // out of Privoxy, they may be in use by older releases.
76 // Note 2: Should *not* include #target part in these URLs.
77 // (It works with MS IE, but is not valid HTTP.)
78 //http://ijbswa.sourceforge.net/user-manual/configuration.html
83 // header ("Location: http://www.junkbusters.com/ht/en/ijb2faq.html");
84 header ("Location: http://www.privoxy.org/faq/");
88 // Config file options
89 // called as redirect.php?v=X.X.X&to=option#optionname
90 // header ("Location: http://www.junkbusters.com/ht/en/ijb2man.html");
91 header ("Location: http://www.privoxy.org/user-manual/configuration.html");
94 // Used by 2.9.0+ on WIN32
95 // header ("Location: http://www.junkbusters.com/ht/en/ijbwin.html");
96 header ("Location: http://www.privoxy.org/user-manual/configuration.html");
99 // // Currently hard-wired into the code.
100 // header ("Location: http://ijbswa.sourceforge.net/");
103 // // Currently hard-wired into the code.
104 // header ("Location: http://www.fsf.org/copyleft/gpl.html");
107 header ("Location: http://www.privoxy.org/");