| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 1 | public function check(DOMElement $template, Tag $tag) |
|
| 27 | { |
||
| 28 | 1 | $nodes = $template->getElementsByTagNameNS(self::XMLNS_XSL, 'copy-of'); |
|
| 29 | 1 | foreach ($nodes as $node) |
|
| 30 | { |
||
| 31 | 1 | $expr = $node->getAttribute('select'); |
|
| 32 | |||
| 33 | 1 | if (!preg_match('#^@[-\\w]*(?:\\s*\\|\\s*@[-\\w]*)*$#D', $expr)) |
|
| 34 | { |
||
| 35 | 1 | throw new UnsafeTemplateException("Cannot assess the safety of '" . $node->nodeName . "' select expression '" . $expr . "'", $node); |
|
| 36 | } |
||
| 37 | } |
||
| 38 | } |
||
| 39 | } |