本文整理汇总了PHP中removeMagicQuotes函数的典型用法代码示例。如果您正苦于以下问题:PHP removeMagicQuotes函数的具体用法?PHP removeMagicQuotes怎么用?PHP removeMagicQuotes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了removeMagicQuotes函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cookie
function cookie($key)
{
if (NJB_REMOVE_MAGIC_QUOTES == false) {
return @$_COOKIE[$key];
} else {
return removeMagicQuotes(@$_COOKIE[$key]);
}
}
示例2: removeMagicQuotes
/**
* Remove magic quotes recursivly
*
* @author Andreas Gohr <andi@splitbrain.org>
* @param array $array
*/
function removeMagicQuotes(&$array)
{
foreach (array_keys($array) as $key) {
if (is_array($array[$key])) {
removeMagicQuotes($array[$key]);
} else {
$array[$key] = stripslashes($array[$key]);
}
}
}
示例3: removeMagicQuotes
function removeMagicQuotes(&$array)
{
if (!get_magic_quotes_gpc()) {
return;
}
foreach ($array as $key => $val) {
if (is_array($val)) {
removeMagicQuotes($array[$key], $trim);
} else {
$array[$key] = stripslashes($val);
}
}
}
示例4: removeMagicQuotes
function removeMagicQuotes(&$postArray, $trim = false)
{
if (!get_magic_quotes_gpc()) {
return;
}
foreach ($postArray as $key => $val) {
if (is_array($val)) {
removeMagicQuotes($postArray[$key], $trim);
} else {
if ($trim == true) {
$val = trim($val);
}
$postArray[$key] = stripslashes($val);
}
}
}
示例5: ucwords
$controller = ucwords($controller);
$model = rtrim($controller, 's');
$controller .= 'Controller';
$dispatch = new $controller($model, $controllerName, $action);
if ((int) method_exists($controller, $action)) {
call_user_func_array(array($dispatch, $action), $queryString);
} else {
/* Error Generation Code Here */
}
}
/** Autoload any classes that are required **/
function __autoload($className)
{
if (file_exists(ROOT . DS . 'library' . DS . strtolower($className) . '.class.php')) {
require_once ROOT . DS . 'library' . DS . strtolower($className) . '.class.php';
} else {
if (file_exists(ROOT . DS . 'application' . DS . 'controllers' . DS . strtolower($className) . '.php')) {
require_once ROOT . DS . 'application' . DS . 'controllers' . DS . strtolower($className) . '.php';
} else {
if (file_exists(ROOT . DS . 'application' . DS . 'models' . DS . strtolower($className) . '.php')) {
require_once ROOT . DS . 'application' . DS . 'models' . DS . strtolower($className) . '.php';
} else {
/* Error Generation Code Here */
}
}
}
}
setReporting();
removeMagicQuotes();
unregisterGlobals();
callHook();
示例6: removeMagicQuotes
<?php
require_once 'toolbox.php';
removeMagicQuotes($_GET);
$turtle = new Turtle($_GET['commands'], 350, 350);
$maxFilenameLength = 20;
$filename = str_replace(array(' ', ':', '"', '?'), array('-', 'c', 'q', 'p'), $_GET['commands']);
if (strlen($filename) > $maxFilenameLength) {
$filenameMd5 = md5($filename);
$filename = substr($filename, 0, $maxFilenameLength) . '_' . $filenameMd5;
}
header("Content-Disposition: Attachment;filename={$filename}.png");
header('Content-Type: image/png');
echo $turtle->getImage();