| @@ 16-35 (lines=20) @@ | ||
| 13 | */ |
|
| 14 | class Img extends ClosedElement |
|
| 15 | { |
|
| 16 | protected function getAllowedAttributes() |
|
| 17 | { |
|
| 18 | $imgAllowedAttributes = array( |
|
| 19 | '/^alt$/i' => Element::ATTR_CS_STRING, |
|
| 20 | '/^src$/i' => Element::ATTR_URI, |
|
| 21 | '/^srcset$/i' => Element::ATTR_CS_STRING, |
|
| 22 | '/^sizes$/i' => Element::ATTR_CS_STRING, |
|
| 23 | '/^crossorigin$/i' => Element::ATTR_CS_STRING, |
|
| 24 | '/^usemap$/i' => Element::ATTR_CS_STRING, |
|
| 25 | '/^ismap$/i' => Element::ATTR_CS_STRING, |
|
| 26 | '/^width$/i' => Element::ATTR_INT, |
|
| 27 | '/^height$/i' => Element::ATTR_INT, |
|
| 28 | '/^referrerpolicy$/i' => Element::ATTR_CS_STRING |
|
| 29 | ); |
|
| 30 | ||
| 31 | return array_merge( |
|
| 32 | $imgAllowedAttributes, |
|
| 33 | parent::getAllowedAttributes() |
|
| 34 | ); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 25-45 (lines=21) @@ | ||
| 22 | */ |
|
| 23 | class Video extends OpenElement implements FlowContent, PhrasingContent, EmbeddedContent, InteractiveContent, TransparentElement |
|
| 24 | { |
|
| 25 | protected function getAllowedAttributes() |
|
| 26 | { |
|
| 27 | $videoAllowedAttributes = array( |
|
| 28 | '/^src$/i' => Element::ATTR_URI, |
|
| 29 | '/^crossorigin$/i' => Element::ATTR_CS_STRING, |
|
| 30 | '/^poster$/i' => Element::ATTR_URI, |
|
| 31 | '/^preload$/i' => Element::ATTR_CI_ENUM . '("","none","metadata","auto"|"")', |
|
| 32 | '/^autoplay$/i' => Element::ATTR_BOOL, |
|
| 33 | '/^mediagroup$/i' => Element::ATTR_CS_STRING, |
|
| 34 | '/^loop$/i' => Element::ATTR_BOOL, |
|
| 35 | '/^muted$/i' => Element::ATTR_BOOL, |
|
| 36 | '/^controls$/i' => Element::ATTR_BOOL, |
|
| 37 | '/^width$/i' => Element::ATTR_INT, |
|
| 38 | '/^height$/i' => Element::ATTR_INT |
|
| 39 | ); |
|
| 40 | ||
| 41 | return array_merge( |
|
| 42 | $videoAllowedAttributes, |
|
| 43 | parent::getAllowedAttributes() |
|
| 44 | ); |
|
| 45 | } |
|
| 46 | ||
| 47 | protected function removeInvalidChildren(LoggerInterface $logger) |
|
| 48 | { |
|