本文整理汇总了PHP中JRequest::_CleanStrip_tags方法的典型用法代码示例。如果您正苦于以下问题:PHP JRequest::_CleanStrip_tags方法的具体用法?PHP JRequest::_CleanStrip_tags怎么用?PHP JRequest::_CleanStrip_tags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRequest
的用法示例。
在下文中一共展示了JRequest::_CleanStrip_tags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Fetches and returns a request array.
*
* The default behaviour is fetching variables depending on the
* current request method: GET and HEAD will result in returning
* $_GET, POST and PUT will result in returning $_POST.
*
* You can force the source by setting the $hash parameter:
*
* post $_POST
* get $_GET
* files $_FILES
* cookie $_COOKIE
* env $_ENV
* server $_SERVER
* method via current $_SERVER['REQUEST_METHOD']
* default $_REQUEST
*
* @static
* @param string $hash to get (POST, GET, FILES, METHOD)
* @param int $mask Filter mask for the variable
* @return mixed Request hash
* @since 1.5
*/
function get($hash = 'default', $mask = 0)
{
$hash = strtoupper($hash);
if ($hash === 'METHOD') {
$hash = strtoupper($_SERVER['REQUEST_METHOD']);
}
switch ($hash) {
case 'GET':
$input = $_GET;
break;
case 'POST':
$input = $_POST;
break;
case 'FILES':
$input = $_FILES;
break;
case 'COOKIE':
$input = $_COOKIE;
break;
case 'ENV':
$input =& $_ENV;
break;
case 'SERVER':
$input =& $_SERVER;
break;
default:
$input = $_REQUEST;
break;
}
$result = JRequest::_cleanVar($input, $mask);
// Handle magic quotes compatability
if (get_magic_quotes_gpc() && $hash != 'FILES') {
$result = JRequest::_stripSlashesRecursive($result);
$result = JRequest::_CleanStrip_tags($result);
$result = JRequest::_CleanSqlInjection($result);
$result = JRequest::_CleanHtmlspecialchars($result);
}
if ($hash == "GET" || $hash == "POST") {
$result = JRequest::_stripSlashesRecursive($result);
$result = JRequest::_CleanStrip_tags($result);
$result = JRequest::_CleanSqlInjection($result);
$result = JRequest::_CleanHtmlspecialchars($result);
}
return $result;
}