Skip to content

Commit

Permalink
Add crossorigin attribute to <audio>, <video>, <img>, <link> and <scr…
Browse files Browse the repository at this point in the history
…ipt>
  • Loading branch information
xemlock committed Sep 2, 2021
1 parent 6ab9042 commit 5f038b7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library/HTMLPurifier/HTML5Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class HTMLPurifier_HTML5Config extends HTMLPurifier_Config
{
const REVISION = 2021083101;
const REVISION = 2021090201;

/**
* @param string|array|HTMLPurifier_Config $config
Expand Down
1 change: 1 addition & 0 deletions library/HTMLPurifier/HTMLModule/HTML5/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function setup($config)
'rel*' => new HTMLPurifier_AttrDef_HTML5_LinkRel(),
'href*' => new HTMLPurifier_AttrDef_URI(true),
'type' => 'Text',
'crossorigin' => 'Enum#anonymous',
));
$this->addElementToContentSet('link', 'Inline');
}
Expand Down
3 changes: 3 additions & 0 deletions library/HTMLPurifier/HTMLModule/HTML5/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function setup($config)
'preload' => 'Enum#auto,metadata,none',
'src' => new HTMLPurifier_AttrDef_URI(true),
'width' => 'Length',
'crossorigin' => 'Enum#anonymous',
));
$this->addElementToContentSet('video', 'Inline');

Expand All @@ -36,6 +37,7 @@ public function setup($config)
'controls' => 'Bool#controls',
'preload' => 'Enum#auto,metadata,none',
'src' => new HTMLPurifier_AttrDef_URI(true),
'crossorigin' => 'Enum#anonymous',
));
$this->addElementToContentSet('audio', 'Inline');

Expand Down Expand Up @@ -67,6 +69,7 @@ public function setup($config)
'srcset' => 'Text',
'sizes' => 'Text',
'loading' => 'Enum#lazy,eager',
'crossorigin' => 'Enum#anonymous',
);
}
}
1 change: 1 addition & 0 deletions library/HTMLPurifier/HTMLModule/HTML5/SafeScripting.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function setup($config)
'async' => new HTMLPurifier_AttrDef_HTML_Bool2(),
'defer' => new HTMLPurifier_AttrDef_HTML_Bool2(),
'charset' => 'Enum#utf-8',
'crossorigin' => 'Enum#anonymous',
)
);

Expand Down
1 change: 1 addition & 0 deletions library/HTMLPurifier/HTMLModule/HTML5/Scripting.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function setup($config)
// If present, its value must be an ASCII case-insensitive match for "utf-8"
// Deprecated: https://html.spec.whatwg.org/multipage/scripting.html#the-script-element
'charset' => 'Enum#utf-8',
'crossorigin' => 'Enum#anonymous',
));
$this->addElementToContentSet('script', 'Inline');

Expand Down

0 comments on commit 5f038b7

Please sign in to comment.