| version 1.25, 2004/12/12 21:44:55 |
version 1.26, 2004/12/12 21:50:18 |
|
|
| * @access public |
* @access public |
| */ |
*/ |
| |
|
| /* $Platon: phpPlatonLib/Platon/Platon.php,v 1.24 2004/12/12 21:41:05 nepto Exp $ */ |
/* $Platon: phpPlatonLib/Platon/Platon.php,v 1.25 2004/12/12 21:44:55 nepto Exp $ */ |
| |
|
| class Platon |
class Platon |
| { |
{ |
|
|
| $ret = ''; |
$ret = ''; |
| if ($exploded_qs != false) { |
if ($exploded_qs != false) { |
| if (! is_array($exploded_qs)) { |
if (! is_array($exploded_qs)) { |
| global $HTTP_SERVER_VARS; |
$exploded_qs = explode('&', $_SERVER['QUERY_STRING']); |
| $exploded_qs = explode('&', $HTTP_SERVER_VARS['QUERY_STRING']); |
|
| } |
} |
| foreach ($exploded_qs as $val) { |
foreach ($exploded_qs as $val) { |
| if (strlen($val) > 0 && strpos($val, '=') === false) { |
if (strlen($val) > 0 && strpos($val, '=') === false) { |
|
|
| } |
} |
| } |
} |
| if ($ret == '') { |
if ($ret == '') { |
| global $HTTP_GET_VARS; |
foreach ($_GET as $key => $val) { |
| foreach ($HTTP_GET_VARS as $key => $val) { |
|
| if (! strcasecmp($key, $key_name) && (is_array($val) || strlen($val) > 0)) { |
if (! strcasecmp($key, $key_name) && (is_array($val) || strlen($val) > 0)) { |
| $ret = $val; |
$ret = $val; |
| break; |
break; |
|
|
| } |
} |
| } |
} |
| if ($ret == '') { |
if ($ret == '') { |
| global $HTTP_POST_VARS; |
foreach ($_POST as $key => $val) { |
| foreach ($HTTP_POST_VARS as $key => $val) { |
|
| if (! strcasecmp($key, $key_name) && (is_array($val) || strlen($val) > 0)) { |
if (! strcasecmp($key, $key_name) && (is_array($val) || strlen($val) > 0)) { |
| $ret = $val; |
$ret = $val; |
| break; |
break; |
|
|
| if ($magic_quotes_gpc === null) { |
if ($magic_quotes_gpc === null) { |
| $magic_quotes_gpc = get_magic_quotes_gpc(); |
$magic_quotes_gpc = get_magic_quotes_gpc(); |
| } |
} |
| global $HTTP_GET_VARS; |
$var = @$_GET[$name]; |
| $var = @$HTTP_GET_VARS[$name]; |
|
| if (! isset($var)) { |
if (! isset($var)) { |
| global $HTTP_POST_VARS; |
$var = @$_POST[$name]; |
| $var = @$HTTP_POST_VARS[$name]; |
|
| } |
} |
| if (isset($var)) { |
if (isset($var)) { |
| if ($magic_quotes_gpc) { |
if ($magic_quotes_gpc) { |
|
|
| */ |
*/ |
| function redirect_test($file, $url) /* {{{ */ |
function redirect_test($file, $url) /* {{{ */ |
| { |
{ |
| global $HTTP_SERVER_VARS; |
if (! isset($_SERVER['PHP_SELF']) |
| if (! isset($HTTP_SERVER_VARS['PHP_SELF']) |
|| ! eregi($file, $_SERVER['PHP_SELF'])) { |
| || ! eregi($file, $HTTP_SERVER_VARS['PHP_SELF'])) { |
|
| return true; |
return true; |
| } |
} |
| if (strlen($url) <= 0) { |
if (strlen($url) <= 0) { |
|
|
| $schema = 'https'; |
$schema = 'https'; |
| } |
} |
| if (strlen($schema) > 0) { |
if (strlen($schema) > 0) { |
| // TODO: create delim according to $HTTP_SERVER_VARS['SCRIPT_NAME'] |
// TODO: create delim according to $_SERVER['SCRIPT_NAME'] |
| $delim = $url[0] == '/' ? '' : '/'; |
$delim = $url[0] == '/' ? '' : '/'; |
| $http_host = @$HTTP_SERVER_VARS['HTTP_HOST']; |
$http_host = @$_SERVER['HTTP_HOST']; |
| $server_name = @$HTTP_SERVER_VARS['SERVER_NAME']; |
$server_name = @$_SERVER['SERVER_NAME']; |
| |
|
| if (isset($http_host) |
if (isset($http_host) |
| && is_string($http_host) |
&& is_string($http_host) |