Helper that strictly validates and sanitises user submitted HTML Intended for use with front-end instances of TinyMCE to ensure XSS is impossible.
This is the code documentation for the SproutCMS project
Search documentation |
class RichTextSanitiserHelper that strictly validates and sanitises user submitted HTML Intended for use with front-end instances of TinyMCE to ensure XSS is impossible.
Variables
Functions
public __constructvoid $RichTextSanitiser->__construct ( string $richtextData [, array $permitted_tags ] ); Construct the sanitiser given a string of HTML private encodeAttributeValuestring|bool $RichTextSanitiser->encodeAttributeValue ( int $type , string $value ); Encodes the value of an attribute using the correct encoding based on type public getErrorsarray $RichTextSanitiser->getErrors ( ); Get the list of errors produced during @see RichTextSanitiser::sanitise public hasErrorsbool $RichTextSanitiser->hasErrors ( ); Checks whether any errors occurred during sanitising public sanitisestring $RichTextSanitiser->sanitise ( ); Gets a sanitised copy of the HTML private sanitiseNodevoid $RichTextSanitiser->sanitiseNode ( DOMNode $node ); Recursively sanitises a node and its children, echoing any output in order of appearance public setLocalResourcesvoid $RichTextSanitiser->setLocalResources ( bool $local ); Set whether to only allow local resources to be referenced by automatically fetching attributes e.g. the src attribute on an <img> tag. Does not apply to the href attribute as that won't be automatically fetched by a browser. |
| Powered by Pelzini, version 0.9.0 |
Documentation is made available under the
GNU Free Documentation License 1.2. Generated: Tuesday, 15th September, 2026 at 10:26 am |
|