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


PHP InputFilter::attrArray方法代码示例

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


在下文中一共展示了InputFilter::attrArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 /** 
  *  Initializer for InputFilter class.
  *
  *  @param string[] $tagsArray  User-provided list of tags to
  *                              either accept or reject.  Default: none
  *  @param string[] $attrArray  User-provided list of attributes to
  *                              either accept or reject.  Default: none
  *  @param boolean $tagsMethod How to apply the list of tags in $tagsArray:
  *  <ul>
  *    <li>true =>  Remove  those tags which are listed in
  *                 $tagsArray.</li>  
  *    <li>false => Allow only those tags which are listed in
  *                 $tagsArray.</li>  
  *  </ul>
  *  Default: false
  *  @param boolean $attrMethod How to apply the list of attributess in $attrArray:
  *  <ul>
  *    <li>true =>  Remove  those attributes which are listed in
  *                 $attrArray.</li>  
  *    <li>false => Allow only those attributes which are listed in
  *                 $attrArray.</li>  
  *  </ul>
  *  Default: false
  *  @param boolean $xssAuto Behavior of {@link filterTags()}:
  *  <ul>
  *    <li>true => Remove tags in {@link $tagBlacklist} and
  *                attributes in {@link $attrBlacklist}, in
  *                addition to all other potentially suspect tags
  *                and attributes.</li>
  *    <li>false => Remove potentially suspect tags and attributes
  *      without consulting{@link $tagBlacklist} or
  *      {@link $attrBlacklist}.</li> 
  *  </ul>
  *  Default: true
  *  @uses $attrArray
  *  @uses $attrMethod
  *  @uses $tagsArray
  *  @uses $tagsMethod
  */
 public function init($tagsArray = array(), $attrArray = array(), $tagsMethod = true, $attrMethod = true, $xssAuto = true)
 {
     // make sure user defined arrays are in lowercase
     for ($i = 0; $i < count($tagsArray); $i++) {
         $tagsArray[$i] = strtolower($tagsArray[$i]);
     }
     for ($i = 0; $i < count($attrArray); $i++) {
         $attrArray[$i] = strtolower($attrArray[$i]);
     }
     // assign to member vars
     self::$tagsArray = (array) $tagsArray;
     self::$attrArray = (array) $attrArray;
     self::$tagsMethod = $tagsMethod;
     self::$attrMethod = $attrMethod;
     self::$xssAuto = $xssAuto;
 }
开发者ID:phpontrax,项目名称:trax,代码行数:55,代码来源:input_filter.php


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