ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
enshrined\svgSanitize\Helper Class Reference
+ Collaboration diagram for enshrined\svgSanitize\Helper:

Static Public Member Functions

static getElementHref (\DOMElement $element)
 
static extractIdReferenceFromHref ($href)
 
static isElementContainedIn (\DOMElement $needle, \DOMElement $haystack)
 

Detailed Description

Definition at line 4 of file Helper.php.

Member Function Documentation

◆ extractIdReferenceFromHref()

static enshrined\svgSanitize\Helper::extractIdReferenceFromHref (   $href)
static
Parameters
string$href
Returns
string|null

Definition at line 25 of file Helper.php.

26 {
27 if (!is_string($href) || strpos($href, '#') !== 0) {
28 return null;
29 }
30 return substr($href, 1);
31 }

Referenced by enshrined\svgSanitize\ElementReference\Resolver\determineInvalidSubjects().

+ Here is the caller graph for this function:

◆ getElementHref()

static enshrined\svgSanitize\Helper::getElementHref ( \DOMElement  $element)
static
Parameters
\DOMElement$element
Returns
string|null

Definition at line 10 of file Helper.php.

11 {
12 if ($element->hasAttribute('href')) {
13 return $element->getAttribute('href');
14 }
15 if ($element->hasAttributeNS('http://www.w3.org/1999/xlink', 'href')) {
16 return $element->getAttributeNS('http://www.w3.org/1999/xlink', 'href');
17 }
18 return null;
19 }

Referenced by enshrined\svgSanitize\ElementReference\Resolver\determineInvalidSubjects().

+ Here is the caller graph for this function:

◆ isElementContainedIn()

static enshrined\svgSanitize\Helper::isElementContainedIn ( \DOMElement  $needle,
\DOMElement  $haystack 
)
static
Parameters
\DOMElement$needle
\DOMElement$haystack
Returns
bool

Definition at line 38 of file Helper.php.

39 {
40 if ($needle === $haystack) {
41 return true;
42 }
43 foreach ($haystack->childNodes as $childNode) {
44 if (!$childNode instanceof \DOMElement) {
45 continue;
46 }
47 if (self::isElementContainedIn($needle, $childNode)) {
48 return true;
49 }
50 }
51 return false;
52 }

Referenced by enshrined\svgSanitize\ElementReference\Resolver\findByElement().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: