本文整理汇总了PHP中array_stripslashes函数的典型用法代码示例。如果您正苦于以下问题:PHP array_stripslashes函数的具体用法?PHP array_stripslashes怎么用?PHP array_stripslashes使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了array_stripslashes函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array_stripslashes
/**
* Strips all slashes from the specified array in place (pass by ref).
* @param Array The array to strip slashes from, typically one of
* $_GET, $_POST, or $_COOKIE.
*/
function array_stripslashes(&$array) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
if (is_array($array))
while (list($key) = each($array))
if (is_array($array[$key]) && $key != $array)
array_stripslashes($array[$key]);
else
$array[$key] = stripslashes($array[$key]);
}
示例2: array_stripslashes
function array_stripslashes($string)
{
if (is_array($string)) {
foreach ($string as $key => $val) {
$string[$key] = array_stripslashes($val);
}
} else {
$string = stripslashes($string);
}
return $string;
}
示例3: array_stripslashes
function array_stripslashes(&$array)
{
if (is_array($array)) {
while (list($key) = each($array)) {
if (is_array($array[$key])) {
array_stripslashes($array[$key]);
} else {
$array[$key] = stripslashes($array[$key]);
}
}
}
}
示例4: array_stripslashes
function array_stripslashes(&$var)
{
if (is_string($var)) {
$var = stripslashes($var);
} else {
if (is_array($var)) {
foreach ($var as $key => $value) {
array_stripslashes($var[$key]);
}
}
}
}
示例5: while
while (list($var, ) = @each($input)) {
if (!in_array($var, $not_unset)) {
unset(${$var});
// Testen
if (isset($GLOBALS[$var])) {
unset($GLOBALS[$var]);
}
}
}
unset($input);
}
// End
if (get_magic_quotes_gpc() == 1) {
while (list($key, $value) = each($_GET)) {
$_GET[$key] = array_stripslashes($value);
}
while (list($key, $value) = each($_POST)) {
$_POST[$key] = array_stripslashes($value);
}
while (list($key, $value) = each($_REQUEST)) {
$_REQUEST[$key] = array_stripslashes($value);
}
}
foreach ($_REQUEST as $key => $value) {
if (is_array($value)) {
$value = array_map('addslashes', $value);
} else {
$value = addslashes($value);
}
$_REQUEST[$key] = $value;
}
示例6: array_stripslashes
/**
* This function will walk recursivly thorugh array and strip slashes from scalar values
*
* @param array $array
* @return null
*/
function array_stripslashes(&$array)
{
if (!is_array($array)) {
return;
}
foreach ($array as $k => $v) {
if (is_array($array[$k])) {
array_stripslashes($array[$k]);
} else {
$array[$k] = stripslashes($array[$k]);
}
// if
}
// foreach
return $array;
}
示例7: bindtextdomain
# set LC_ALL to de_DE
bindtextdomain('messages', LANGDIR);
bind_textdomain_codeset('messages', 'UTF-8');
textdomain('messages');
header('Content-type: text/html; charset=UTF-8', true);
}
}
/**
* Strip slashes from GET, POST, and COOKIE variables if this
* PHP install is configured to automatically addslashes()
*/
if (@get_magic_quotes_gpc() && (!isset($slashes_stripped) || !$slashes_stripped)) {
array_stripslashes($_REQUEST);
array_stripslashes($_GET);
array_stripslashes($_POST);
array_stripslashes($_COOKIE);
$slashes_stripped = true;
}
# Create our application repository variable.
$app['server'] = $_SESSION[APPCONFIG]->getServer(get_request('server_id', 'REQUEST'));
/**
* Look/evaluate our timeout
*/
if (!$app['server']->isSessionValid()) {
system_message(array('title' => _('Session Timed Out'), 'body' => sprintf('%s %s %s', _('Your Session timed out after'), $app['server']->getValue('login', 'timeout'), _('min. of inactivity. You have been automatically logged out.')), 'type' => 'info'), sprintf('index.php?server_id=%s&refresh=SID_%s', $app['server']->getIndex(), $app['server']->getIndex()));
die;
}
# If syslog is enabled, we need to include the supporting file.
if ($_SESSION[APPCONFIG]->getValue('debug', 'syslog')) {
require LIBDIR . 'syslog.php';
}
示例8: configure
protected function configure()
{
@mb_internal_encoding('UTF-8');
@ini_set('default_charset', 'utf-8');
@ini_set('register_globals', 'off');
// magic quotes
@ini_set("magic_quotes_runtime", 0);
if (version_compare('5.4', PHP_VERSION, '>') && function_exists('set_magic_quotes_runtime') && get_magic_quotes_runtime()) {
@set_magic_quotes_runtime(false);
}
// IIS
if (!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING'])) {
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}
self::$system_options['mod_rewrite'] = false;
}
if (!get_magic_quotes_gpc()) {
return;
}
function array_stripslashes($array)
{
return is_array($array) ? array_map("array_stripslashes", $array) : stripslashes($array);
}
$_GET = array_stripslashes($_GET);
$_POST = array_stripslashes($_POST);
$_COOKIE = array_stripslashes($_COOKIE);
$_REQUEST = array_stripslashes($_REQUEST);
}
示例9: array_stripslashes
/**
* Strips all slashes from the specified array in place (pass by ref).
* @param Array $array The array to strip slashes from, typically one of
* $_GET, $_POST, or $_COOKIE.
*/
function array_stripslashes(&$array)
{
if (DEBUG_ENABLED) {
debug_log('array_stripslashes(): Entered with (%s)', 1, $array);
}
if (is_array($array)) {
while (list($key) = each($array)) {
if (is_array($array[$key]) && $key != $array) {
array_stripslashes($array[$key]);
} else {
$array[$key] = stripslashes($array[$key]);
}
}
}
}
示例10: array_stripslashes
function array_stripslashes(&$var)
{
if (is_array($var)) {
foreach ($var as $k => &$v) {
array_stripslashes($v);
}
} else {
$var = stripslashes($var);
}
return $var;
}
示例11: strip_if_magic
/**
* Strips slashes from a var if magic_quotes_gqc is enabled
*
* @param mixed $data
* @return mixed
*/
function strip_if_magic($data)
{
if (MAGIC_QUOTES_GPC == true) {
return array_stripslashes($data);
} else {
return $data;
}
}
示例12: substr
// View_
require_once VIEWS_PATH . substr($classPath, 5);
break;
case 5:
// Model_
require_once MODELS_PATH . substr($classPath, 6);
break;
}
}
}
set_error_handler(create_function('$errno, $errstr, $errfile, $errline', '
throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
'), E_ALL & ~E_NOTICE);
function array_stripslashes($item)
{
return is_array($item) ? array_map('array_stripslashes', $item) : stripslashes($item);
}
if (get_magic_quotes_gpc()) {
if ($_GET) {
$_GET = array_stripslashes($_GET);
}
if ($_POST) {
$_POST = array_stripslashes($_POST);
}
if ($_COOKIES) {
$_COOKIES = array_stripslashes($_COOKIES);
}
if ($_REQUEST) {
$_REQUEST = array_stripslashes($_REQUEST);
}
}
示例13: array_stripslashes
function array_stripslashes(&$array)
{
while (list($key, $var) = each($array)) {
if ((strtoupper($key) != $key || '' . intval($key) == "{$key}") && $key != 'argc' && $key != 'argv') {
if (is_string($var)) {
$array[$key] = stripslashes($var);
}
if (is_array($var)) {
$array[$key] = array_stripslashes($var);
}
}
}
return $array;
}