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.
Extending this class<?php
/**
* New class description goes here
*
* @author Your Name, 2026-09-15
**/
class NewClassName extends RichTextSanitiser {
/**
* Gets a sanitised copy of the HTML
**/
public function sanitise () {
// Method code goes here
}
/**
* Checks whether any errors occurred during sanitising
**/
public function hasErrors () {
// Method code goes here
}
/**
* Get the list of errors produced during @see RichTextSanitiser::sanitise
**/
public function getErrors () {
// Method code goes here
}
/**
* 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.
**/
public function setLocalResources (bool $local) {
// Method code goes here
}
/**
* Recursively sanitises a node and its children, echoing any output in order of appearance
**/
private function sanitiseNode (DOMNode $node) {
// Method code goes here
}
/**
* Encodes the value of an attribute using the correct encoding based on type
**/
private function encodeAttributeValue (int $type, string $value) {
// Method code goes here
}
/**
* Construct the sanitiser given a string of HTML
**/
public function __construct (string $richtextData, array $permitted_tags) {
// Method code goes here
}
}
?>
|
| 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 |
|