Definition at line 4 of file Helper.php.
◆ extractIdReferenceFromHref()
static enshrined\svgSanitize\Helper::extractIdReferenceFromHref |
( |
|
$href | ) |
|
|
static |
◆ getElementHref()
static enshrined\svgSanitize\Helper::getElementHref |
( |
\DOMElement |
$element | ) |
|
|
static |
- Parameters
-
- 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().
◆ 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().
The documentation for this class was generated from the following file:
- libs/composer/vendor/enshrined/svg-sanitize/src/Helper.php