PHP Class PicoFeed\Filter\Tag

Author: Frederic Guillot
Inheritance: extends PicoFeed\Base
Afficher le fichier Open project: fguillot/picofeed Class Usage Examples

Méthodes publiques

Méthode Description
closeHtmlTag ( string $tag ) : string Return the HTML closing tag.
isAllowed ( string $tag, array $attributes ) : boolean Check if the tag is allowed and is not a pixel tracker.
isAllowedTag ( string $tag ) : boolean Check if a tag is on the whitelist.
isPixelTracker ( string $tag, array $attributes ) : boolean Detect if an image tag is a pixel tracker.
isSelfClosingTag ( string $tag ) : boolean Return true is the tag is self-closing.
openHtmlTag ( string $tag, string $attributes = '' ) : string Return the HTML opening tag.
removeBlacklistedTags ( string $data ) : string Remove script tags.
removeEmptyTags ( string $data ) : string Remove empty tags.
removeMultipleBreakTags ( string $data ) : string Replace

by only one.
setWhitelistedTags ( array $values ) : Tag Set whitelisted tags adn attributes for each tag.

Method Details

closeHtmlTag() public méthode

Return the HTML closing tag.
public closeHtmlTag ( string $tag ) : string
$tag string Tag name
Résultat string

isAllowed() public méthode

Check if the tag is allowed and is not a pixel tracker.
public isAllowed ( string $tag, array $attributes ) : boolean
$tag string Tag name
$attributes array Attributes dictionary
Résultat boolean

isAllowedTag() public méthode

Check if a tag is on the whitelist.
public isAllowedTag ( string $tag ) : boolean
$tag string Tag name
Résultat boolean

isPixelTracker() public méthode

Detect if an image tag is a pixel tracker.
public isPixelTracker ( string $tag, array $attributes ) : boolean
$tag string Tag name
$attributes array Tag attributes
Résultat boolean

isSelfClosingTag() public méthode

Return true is the tag is self-closing.
public isSelfClosingTag ( string $tag ) : boolean
$tag string Tag name
Résultat boolean

openHtmlTag() public méthode

Return the HTML opening tag.
public openHtmlTag ( string $tag, string $attributes = '' ) : string
$tag string Tag name
$attributes string Attributes converted in html
Résultat string

removeBlacklistedTags() public méthode

Remove script tags.
public removeBlacklistedTags ( string $data ) : string
$data string Input data
Résultat string

removeEmptyTags() public méthode

Remove empty tags.
public removeEmptyTags ( string $data ) : string
$data string Input data
Résultat string

removeMultipleBreakTags() public méthode

Replace

by only one.
public removeMultipleBreakTags ( string $data ) : string
$data string Input data
Résultat string

setWhitelistedTags() public méthode

Set whitelisted tags adn attributes for each tag.
public setWhitelistedTags ( array $values ) : Tag
$values array List of tags: ['video' => ['src', 'cover'], 'img' => ['src']]
Résultat Tag