當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。