| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | 4 | public function check(DOMElement $template, Tag $tag) |
|
| 42 | { |
||
| 43 | 4 | $xpath = new DOMXPath($template->ownerDocument); |
|
| 44 | $query |
||
| 45 | 4 | = '//*[translate(local-name(), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "' . $this->elName . '"]' |
|
| 46 | 4 | . '|' |
|
| 47 | 4 | . '//xsl:element[translate(@name,"ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") = "' . $this->elName . '"]'; |
|
| 48 | |||
| 49 | 4 | $node = $xpath->query($query)->item(0); |
|
| 50 | 4 | if ($node) |
|
| 51 | { |
||
| 52 | 4 | throw new UnsafeTemplateException("Element '" . $this->elName . "' is disallowed", $node); |
|
| 53 | } |
||
| 54 | } |
||
| 55 | } |