global.php
程序员文章站
2022-09-20 10:00:09
<?php
/**
* 自动判断php版本,并把所有环境变量转为全局变量
*
* @author avenger <avenger@php.net>
* @version $id 2003-05-18 13:01:14 $
*/
function pmyoutput(&$a) {
if (is_array($a)) {
array_walk($a,'pmyoutput');
} else {
$a = stripslashes($a);
$a = str_replace('"', '"', $a);
}
}
function pmyinput(&$a) {
if (is_array($a)) {
array_walk($a,'pmyinput');
} else {
$a = addslashes($a);
}
}
/*
if (phpversion() < '4.1.0') {
isset($http_session_vars) ? $globals['_session'] = &$http_session_vars : '';
isset($http_server_vars) ? $globals['_server'] = &$http_server_vars : '';
isset($http_env_vars) ? $globals['_env'] = &$http_env_vars : '';
isset($http_files_vars) ? $globals['_files'] = &$http_files_vars : '';
if (get_magic_quotes_gpc() == 1) {
isset($http_get_vars) ? $globals['_get'] = &$http_get_vars : '';
isset($http_post_vars) ? $globals['_post'] = &$http_post_vars : '';
isset($http_cookie_vars) ? $globals['_cookie'] = &$http_cookie_vars : '';
} else {
isset($http_get_vars) ? pmyinput($http_get_vars) : '';
isset($http_post_vars) ? pmyinput($http_post_vars) : '';
isset($http_cookie_vars) ? pmyinput($http_cookie_vars) : '';
$globals['_get'] = &$http_get_vars;
$globals['_post'] = &$http_post_vars;
$globals['_cookie'] = &$http_cookie_vars;
}
$globals['_request'] = array_merge($_get, $_post, $_cookie);
} else {
if (get_magic_quotes_gpc() != 1) {
isset($_get) ? pmyinput($_get) : '';
isset($_post) ? pmyinput($_post) : '';
isset($_cookie) ? pmyinput($_cookie) : '';
isset($_request) ? pmyinput($_request) : '';
}
}
*/
?>
/**
* 自动判断php版本,并把所有环境变量转为全局变量
*
* @author avenger <avenger@php.net>
* @version $id 2003-05-18 13:01:14 $
*/
function pmyoutput(&$a) {
if (is_array($a)) {
array_walk($a,'pmyoutput');
} else {
$a = stripslashes($a);
$a = str_replace('"', '"', $a);
}
}
function pmyinput(&$a) {
if (is_array($a)) {
array_walk($a,'pmyinput');
} else {
$a = addslashes($a);
}
}
/*
if (phpversion() < '4.1.0') {
isset($http_session_vars) ? $globals['_session'] = &$http_session_vars : '';
isset($http_server_vars) ? $globals['_server'] = &$http_server_vars : '';
isset($http_env_vars) ? $globals['_env'] = &$http_env_vars : '';
isset($http_files_vars) ? $globals['_files'] = &$http_files_vars : '';
if (get_magic_quotes_gpc() == 1) {
isset($http_get_vars) ? $globals['_get'] = &$http_get_vars : '';
isset($http_post_vars) ? $globals['_post'] = &$http_post_vars : '';
isset($http_cookie_vars) ? $globals['_cookie'] = &$http_cookie_vars : '';
} else {
isset($http_get_vars) ? pmyinput($http_get_vars) : '';
isset($http_post_vars) ? pmyinput($http_post_vars) : '';
isset($http_cookie_vars) ? pmyinput($http_cookie_vars) : '';
$globals['_get'] = &$http_get_vars;
$globals['_post'] = &$http_post_vars;
$globals['_cookie'] = &$http_cookie_vars;
}
$globals['_request'] = array_merge($_get, $_post, $_cookie);
} else {
if (get_magic_quotes_gpc() != 1) {
isset($_get) ? pmyinput($_get) : '';
isset($_post) ? pmyinput($_post) : '';
isset($_cookie) ? pmyinput($_cookie) : '';
isset($_request) ? pmyinput($_request) : '';
}
}
*/
?>