Documentation

IMP_Mime_Viewer_Html extends Horde_Mime_Viewer_Html
in package

Renderer of HTML data, attempting to remove malicious code.

Tags
author

Anil Madhavapeddy anil@recoil.org

author

Jon Parise jon@horde.org

author

Michael Slusarz slusarz@horde.org

category

Horde

copyright

1999-2017 Horde LLC

license

http://www.horde.org/licenses/gpl GPL

Table of Contents

Constants

CSS_BG_PREG  = '/(background(?:-image)?:[^;\\}]*(?:url\\(["\']?))(.*?)((?:["\']?\\)))/i'
CSS background regex.
CSSBLOCK  = 'htmlcssblocked'
Blocked attributes.
IMGBLOCK  = 'htmlimgblocked'
SRCSETBLOCK  = 'htmlimgblocked_srcset'

Properties

$_capability  : array<string|int, mixed>
This driver's display capabilities.
$_imptmp  : array<string|int, mixed>
Temp array for storing data when parsing the HTML document.

Methods

_cidSearch()  : string
Search for a CID in a related part.
_imgBlock()  : bool
Are we blocking images?
_imgBlockImg()  : string
The HTML image source to use for blocked images.
_IMPrender()  : array<string|int, mixed>
Render out the currently set contents.
_node()  : mixed
_parseCss()  : mixed
_processDomDocument()  : mixed
_render()  : array<string|int, mixed>
Return the full rendered version of the Horde_Mime_Part object.
_renderInfo()  : array<string|int, mixed>
Return the rendered information about the Horde_Mime_Part object.
_renderInline()  : array<string|int, mixed>
Return the rendered inline version of the Horde_Mime_Part object.
_styleCallback()  : string
preg_replace_callback() callback for style/background matching of images.

Constants

CSS_BG_PREG

CSS background regex.

public mixed CSS_BG_PREG = '/(background(?:-image)?:[^;\\}]*(?:url\\(["\']?))(.*?)((?:["\']?\\)))/i'

CSSBLOCK

Blocked attributes.

public mixed CSSBLOCK = 'htmlcssblocked'

IMGBLOCK

public mixed IMGBLOCK = 'htmlimgblocked'

SRCSETBLOCK

public mixed SRCSETBLOCK = 'htmlimgblocked_srcset'

Properties

$_capability

This driver's display capabilities.

protected array<string|int, mixed> $_capability = array('full' => \true, 'info' => \true, 'inline' => \true, 'raw' => \false)

$_imptmp

Temp array for storing data when parsing the HTML document.

protected array<string|int, mixed> $_imptmp = array()

Methods

_cidSearch()

Search for a CID in a related part.

protected _cidSearch(string $cid[, bool $save = true ]) : string
Parameters
$cid : string

The CID to query.

$save : bool = true

Save as a CID used?

Return values
string

The MIME ID of the part, or null if not found.

_imgBlock()

Are we blocking images?

protected _imgBlock() : bool
Return values
bool

True if blocking images.

_imgBlockImg()

The HTML image source to use for blocked images.

protected _imgBlockImg() : string
Return values
string

The HTML image source.

_IMPrender()

Render out the currently set contents.

protected _IMPrender(bool $inline) : array<string|int, mixed>
Parameters
$inline : bool

Are we viewing inline?

Return values
array<string|int, mixed>

Two elements: html and status.

_node()

protected _node(mixed $doc, mixed $node) : mixed
Parameters
$doc : mixed
$node : mixed

_parseCss()

protected _parseCss(mixed $css, mixed $blocked) : mixed
Parameters
$css : mixed
$blocked : mixed

_processDomDocument()

protected _processDomDocument(mixed $doc) : mixed
Parameters
$doc : mixed

_render()

Return the full rendered version of the Horde_Mime_Part object.

protected _render() : array<string|int, mixed>
Return values
array<string|int, mixed>

See parent::render().

_renderInfo()

Return the rendered information about the Horde_Mime_Part object.

protected _renderInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>

See parent::render().

_renderInline()

Return the rendered inline version of the Horde_Mime_Part object.

protected _renderInline() : array<string|int, mixed>
Return values
array<string|int, mixed>

See parent::render().

_styleCallback()

preg_replace_callback() callback for style/background matching of images.

protected _styleCallback(array<string|int, mixed> $matches) : string
Parameters
$matches : array<string|int, mixed>

The list of matches.

Return values
string

The replacement image string.


        
On this page

Search results