Documentation

AddTags

int CBXSanitizer::AddTags(
 array arTags
)

The method adds tags and their attributes into the whitelist.

Returns number of tags added into the whitelist.

CBXSanitizer::AddTags() can be called only as the initialized object method and not as the static method of CBXSanitizer class.

Parameters

ParameterDescrption
arTagsArray containing tags and attributes of permitted tags. It has the following structure:
  • Permitted tag name 1
    • Attribute name 1
    • Attribute name 2
    • ...
  • Permitted tag name 2
    • Attribute name 1
    • Attribute name 2
    • ...
  • ...
    • ...

Example

  $Sanitizer->AddTags( array (
                  'a' = > array('href','id','style','alt'...),
                  'br' => array()
                  ));


© «Bitrix24», 2001-2022
Up