PHP 클래스 PicoFeed\Filter\Tag

저자: Frederic Guillot
상속: extends PicoFeed\Base
파일 보기 프로젝트 열기: fguillot/picofeed 1 사용 예제들

공개 메소드들

메소드 설명
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