| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | protected function normalizeAttribute(DOMAttr $attribute) |
||
| 33 | { |
||
| 34 | $match = [ |
||
| 35 | '(\\b(?:do|else|(?:if|while)\\s*\\(.*?\\))\\s*\\{(?![{@]))', |
||
| 36 | '((?<!\\{)(?:\\{\\{)*\\{(?!\\{)[^}]*+$)', |
||
| 37 | '((?<!\\{)\\{\\s*(?:"[^"]*"|\'[^\']*\'|[a-z]\\w*(?:\\s|:\\s|:(?:["\']|\\w+\\s*,))))i' |
||
| 38 | ]; |
||
| 39 | $replace = [ |
||
| 40 | '$0{', |
||
| 41 | '{$0', |
||
| 42 | '{$0' |
||
| 43 | ]; |
||
| 44 | $attrValue = preg_replace($match, $replace, $attribute->value); |
||
| 45 | $attribute->value = htmlspecialchars($attrValue, ENT_NOQUOTES, 'UTF-8'); |
||
| 46 | } |
||
| 47 | } |