本文整理汇总了PHP中SJB_HelperFunctions::unquote方法的典型用法代码示例。如果您正苦于以下问题:PHP SJB_HelperFunctions::unquote方法的具体用法?PHP SJB_HelperFunctions::unquote怎么用?PHP SJB_HelperFunctions::unquote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SJB_HelperFunctions
的用法示例。
在下文中一共展示了SJB_HelperFunctions::unquote方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unquote
/**
* unquoting data if 'magic_quotes_gpc' is turn on
* Function unquotes data, if 'magic_quotes_gpc' is turn on
* @param array $arr array of data to unquote
*/
public static function unquote(&$arr)
{
if (!@ini_get('magic_quotes_gpc')) {
return;
}
foreach ($arr as $index => $value) {
if (is_array($arr[$index])) {
SJB_HelperFunctions::unquote($arr[$index]);
} else {
$arr[$index] = stripslashes($arr[$index]);
}
}
}
示例2: prepareGlobalArrays
public static function prepareGlobalArrays()
{
// simulating turning off register_globals if it's on
if (@ini_get("register_globals")) {
$unset = array_keys($_ENV + $_GET + $_POST + $_COOKIE + $_SERVER + $_SESSION);
foreach ($unset as $rg_var) {
if (isset(${$rg_var})) {
unset(${$rg_var});
}
}
unset($unset);
}
switch ($_SERVER['REQUEST_METHOD']) {
case 'POST':
$_REQUEST = $_POST;
break;
case 'GET':
$_REQUEST = $_GET;
break;
}
// turning of 'magic_quotes_runtime' (for outputting information)
ini_set('magic_quotes_runtime', false);
// unquoting request data if 'get_magic_quotes_gpc' is turned on
if (ini_get('magic_quotes_gpc')) {
SJB_HelperFunctions::unquote($_REQUEST);
SJB_HelperFunctions::unquote($_POST);
SJB_HelperFunctions::unquote($_GET);
}
//-- setting temp directory if there isn't available one
$isCacheDirGood = false;
foreach (array($_ENV, $_SERVER) as $tab) {
foreach (array('TMPDIR', 'TEMP', 'TMP', 'windir', 'SystemRoot') as $key) {
if (isset($tab[$key])) {
if ($key == 'windir' || $key == 'SystemRoot') {
$dir = realpath($tab[$key] . '\\temp');
} else {
$dir = realpath($tab[$key]);
}
if (is_readable($dir) && is_writable($dir)) {
$isCacheDirGood = true;
break 2;
}
}
}
}
if ($isCacheDirGood === false) {
$_SERVER['TMP'] = SJB_BASE_DIR . 'system/cache/';
}
}