PHP Класс PicoFeed\Filter\Tag

Автор: Frederic Guillot
Наследование: extends PicoFeed\Base
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

closeHtmlTag() публичный Метод

Return the HTML closing tag.
public closeHtmlTag ( string $tag ) : string
$tag string Tag name
Результат string

isAllowed() публичный Метод

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
Результат boolean

isAllowedTag() публичный Метод

Check if a tag is on the whitelist.
public isAllowedTag ( string $tag ) : boolean
$tag string Tag name
Результат boolean

isPixelTracker() публичный Метод

Detect if an image tag is a pixel tracker.
public isPixelTracker ( string $tag, array $attributes ) : boolean
$tag string Tag name
$attributes array Tag attributes
Результат boolean

isSelfClosingTag() публичный Метод

Return true is the tag is self-closing.
public isSelfClosingTag ( string $tag ) : boolean
$tag string Tag name
Результат boolean

openHtmlTag() публичный Метод

Return the HTML opening tag.
public openHtmlTag ( string $tag, string $attributes = '' ) : string
$tag string Tag name
$attributes string Attributes converted in html
Результат string

removeBlacklistedTags() публичный Метод

Remove script tags.
public removeBlacklistedTags ( string $data ) : string
$data string Input data
Результат string

removeEmptyTags() публичный Метод

Remove empty tags.
public removeEmptyTags ( string $data ) : string
$data string Input data
Результат string

removeMultipleBreakTags() публичный Метод

Replace

by only one.
public removeMultipleBreakTags ( string $data ) : string
$data string Input data
Результат string

setWhitelistedTags() публичный Метод

Set whitelisted tags adn attributes for each tag.
public setWhitelistedTags ( array $values ) : Tag
$values array List of tags: ['video' => ['src', 'cover'], 'img' => ['src']]
Результат Tag