当前位置: 首页>>代码示例>>PHP>>正文


PHP JRequest::_CleanHtmlspecialchars方法代码示例

本文整理汇总了PHP中JRequest::_CleanHtmlspecialchars方法的典型用法代码示例。如果您正苦于以下问题:PHP JRequest::_CleanHtmlspecialchars方法的具体用法?PHP JRequest::_CleanHtmlspecialchars怎么用?PHP JRequest::_CleanHtmlspecialchars使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JRequest的用法示例。


在下文中一共展示了JRequest::_CleanHtmlspecialchars方法的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;
 }
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:69,代码来源:request.php


注:本文中的JRequest::_CleanHtmlspecialchars方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。