|
4 | 4 |
|
5 | 5 | use Bavix\AdvancedHtmlDom\CacheSystem\InterfaceCache; |
6 | 6 |
|
7 | | -$attributes = array( |
| 7 | +$attributes = [ |
8 | 8 | 'href', 'src', 'id', 'class', 'name', |
9 | 9 | 'text', 'height', 'width', 'content', |
10 | 10 | 'value', 'title', 'alt' |
11 | | -); |
| 11 | +]; |
12 | 12 |
|
13 | | -$tags = array( |
| 13 | +$tags = [ |
14 | 14 | 'a', 'abbr', 'address', 'area', 'article', 'aside', |
15 | 15 | 'audio', 'b', 'base', 'blockquote', 'body', 'br', |
16 | 16 | 'button', 'canvas', 'caption', 'cite', 'code', 'col', |
|
25 | 25 | 'strong', 'style', 'sub', 'sup', 'table', 'tbody', 'td', |
26 | 26 | 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', |
27 | 27 | 'track', 'u', 'ul', 'var', 'video' |
28 | | -); |
| 28 | +]; |
29 | 29 |
|
30 | | -$tags = implode('|', $tags); |
31 | | -$attributes = implode('|', $attributes); |
| 30 | +$tags = \implode('|', $tags); |
| 31 | +$attributes = \implode('|', $attributes); |
32 | 32 |
|
33 | 33 | /** |
34 | 34 | * TAG_REGEX |
35 | 35 | */ |
36 | | -define('TAG_REGEX', '/^(' . $tags . ')$/'); |
| 36 | +\define('TAG_REGEX', '/^(' . $tags . ')$/'); |
37 | 37 |
|
38 | 38 | /** |
39 | 39 | * TAGS_REGEX |
40 | 40 | */ |
41 | | -define('TAGS_REGEX', '/^(' . $tags . ')e?s$/'); |
| 41 | +\define('TAGS_REGEX', '/^(' . $tags . ')e?s$/'); |
42 | 42 |
|
43 | 43 | /** |
44 | 44 | * ATTRIBUTE_REGEX |
45 | 45 | */ |
46 | | -define('ATTRIBUTE_REGEX', '/^(' . $attributes . '|data-\w+)$/'); |
| 46 | +\define('ATTRIBUTE_REGEX', '/^(' . $attributes . '|data-[\w\-]+)$/'); |
47 | 47 |
|
48 | 48 | /** |
49 | 49 | * ATTRIBUTES_REGEX |
50 | 50 | */ |
51 | | -define('ATTRIBUTES_REGEX', '/^(' . $attributes . '|data-\w+)e?s$/'); |
| 51 | +\define('ATTRIBUTES_REGEX', '/^(' . $attributes . '|data-[\w\-]+)e?s$/'); |
52 | 52 |
|
53 | 53 | /** |
54 | 54 | * @param string $html |
|
0 commit comments