\midcom_helper_xsspreventer

Library for escaping user provided values displayed for example in input etc

Summary

Methods
Properties
Constants
escape_attribute()
escape_element()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

escape_attribute()

escape_attribute(string  $input) : string

Escape value of an XML attribute, also adds quotes around it

Parameters

string $input

Attribute value to escape

Returns

string —

escaped $input (with added quotes)

escape_element()

escape_element(string  $element, string  $input) : string

Escape contents of an XML element (basically prevents early closure of the element)

Parameters

string $element

XML element to close

string $input

Element content to escape

Returns

string —

$input with $element closing tags escaped