Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fc66381

Browse filesBrowse files
committed
minor #59531 [HtmlSanitizer] fix tests (xabbuh)
This PR was merged into the 6.4 branch. Discussion ---------- [HtmlSanitizer] fix tests | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT The files we used to download are no longer part of the WICG/sanitizer-api repository (see WICG/sanitizer-api#244). Commits ------- 8f06032 fix tests
2 parents 380e0d8 + 8f06032 commit fc66381
Copy full SHA for fc66381

File tree

Expand file treeCollapse file tree

3 files changed

+346
-18
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+346
-18
lines changed
+213Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
[
2+
"abbr",
3+
"accept",
4+
"accept-charset",
5+
"accesskey",
6+
"action",
7+
"align",
8+
"alink",
9+
"allow",
10+
"allowfullscreen",
11+
"allowpaymentrequest",
12+
"alt",
13+
"anchor",
14+
"archive",
15+
"as",
16+
"async",
17+
"autocapitalize",
18+
"autocomplete",
19+
"autocorrect",
20+
"autofocus",
21+
"autopictureinpicture",
22+
"autoplay",
23+
"axis",
24+
"background",
25+
"behavior",
26+
"bgcolor",
27+
"border",
28+
"bordercolor",
29+
"capture",
30+
"cellpadding",
31+
"cellspacing",
32+
"challenge",
33+
"char",
34+
"charoff",
35+
"charset",
36+
"checked",
37+
"cite",
38+
"class",
39+
"classid",
40+
"clear",
41+
"code",
42+
"codebase",
43+
"codetype",
44+
"color",
45+
"cols",
46+
"colspan",
47+
"compact",
48+
"content",
49+
"contenteditable",
50+
"controls",
51+
"controlslist",
52+
"conversiondestination",
53+
"coords",
54+
"crossorigin",
55+
"csp",
56+
"data",
57+
"datetime",
58+
"declare",
59+
"decoding",
60+
"default",
61+
"defer",
62+
"dir",
63+
"direction",
64+
"dirname",
65+
"disabled",
66+
"disablepictureinpicture",
67+
"disableremoteplayback",
68+
"disallowdocumentaccess",
69+
"download",
70+
"draggable",
71+
"elementtiming",
72+
"enctype",
73+
"end",
74+
"enterkeyhint",
75+
"event",
76+
"exportparts",
77+
"face",
78+
"for",
79+
"form",
80+
"formaction",
81+
"formenctype",
82+
"formmethod",
83+
"formnovalidate",
84+
"formtarget",
85+
"frame",
86+
"frameborder",
87+
"headers",
88+
"height",
89+
"hidden",
90+
"high",
91+
"href",
92+
"hreflang",
93+
"hreftranslate",
94+
"hspace",
95+
"http-equiv",
96+
"id",
97+
"imagesizes",
98+
"imagesrcset",
99+
"importance",
100+
"impressiondata",
101+
"impressionexpiry",
102+
"incremental",
103+
"inert",
104+
"inputmode",
105+
"integrity",
106+
"invisible",
107+
"is",
108+
"ismap",
109+
"keytype",
110+
"kind",
111+
"label",
112+
"lang",
113+
"language",
114+
"latencyhint",
115+
"leftmargin",
116+
"link",
117+
"list",
118+
"loading",
119+
"longdesc",
120+
"loop",
121+
"low",
122+
"lowsrc",
123+
"manifest",
124+
"marginheight",
125+
"marginwidth",
126+
"max",
127+
"maxlength",
128+
"mayscript",
129+
"media",
130+
"method",
131+
"min",
132+
"minlength",
133+
"multiple",
134+
"muted",
135+
"name",
136+
"nohref",
137+
"nomodule",
138+
"nonce",
139+
"noresize",
140+
"noshade",
141+
"novalidate",
142+
"nowrap",
143+
"object",
144+
"open",
145+
"optimum",
146+
"part",
147+
"pattern",
148+
"ping",
149+
"placeholder",
150+
"playsinline",
151+
"policy",
152+
"poster",
153+
"preload",
154+
"pseudo",
155+
"readonly",
156+
"referrerpolicy",
157+
"rel",
158+
"reportingorigin",
159+
"required",
160+
"resources",
161+
"rev",
162+
"reversed",
163+
"role",
164+
"rows",
165+
"rowspan",
166+
"rules",
167+
"sandbox",
168+
"scheme",
169+
"scope",
170+
"scopes",
171+
"scrollamount",
172+
"scrolldelay",
173+
"scrolling",
174+
"select",
175+
"selected",
176+
"shadowroot",
177+
"shadowrootdelegatesfocus",
178+
"shape",
179+
"size",
180+
"sizes",
181+
"slot",
182+
"span",
183+
"spellcheck",
184+
"src",
185+
"srcdoc",
186+
"srclang",
187+
"srcset",
188+
"standby",
189+
"start",
190+
"step",
191+
"style",
192+
"summary",
193+
"tabindex",
194+
"target",
195+
"text",
196+
"title",
197+
"topmargin",
198+
"translate",
199+
"truespeed",
200+
"trusttoken",
201+
"type",
202+
"usemap",
203+
"valign",
204+
"value",
205+
"valuetype",
206+
"version",
207+
"virtualkeyboardpolicy",
208+
"vlink",
209+
"vspace",
210+
"webkitdirectory",
211+
"width",
212+
"wrap"
213+
]
+130Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
[
2+
"a",
3+
"abbr",
4+
"acronym",
5+
"address",
6+
"area",
7+
"article",
8+
"aside",
9+
"audio",
10+
"b",
11+
"basefont",
12+
"bdi",
13+
"bdo",
14+
"bgsound",
15+
"big",
16+
"blockquote",
17+
"body",
18+
"br",
19+
"button",
20+
"canvas",
21+
"caption",
22+
"center",
23+
"cite",
24+
"code",
25+
"col",
26+
"colgroup",
27+
"command",
28+
"data",
29+
"datalist",
30+
"dd",
31+
"del",
32+
"details",
33+
"dfn",
34+
"dialog",
35+
"dir",
36+
"div",
37+
"dl",
38+
"dt",
39+
"em",
40+
"fieldset",
41+
"figcaption",
42+
"figure",
43+
"font",
44+
"footer",
45+
"form",
46+
"h1",
47+
"h2",
48+
"h3",
49+
"h4",
50+
"h5",
51+
"h6",
52+
"head",
53+
"header",
54+
"hgroup",
55+
"hr",
56+
"html",
57+
"i",
58+
"image",
59+
"img",
60+
"input",
61+
"ins",
62+
"kbd",
63+
"keygen",
64+
"label",
65+
"layer",
66+
"legend",
67+
"li",
68+
"link",
69+
"listing",
70+
"main",
71+
"map",
72+
"mark",
73+
"marquee",
74+
"menu",
75+
"meta",
76+
"meter",
77+
"nav",
78+
"nobr",
79+
"ol",
80+
"optgroup",
81+
"option",
82+
"output",
83+
"p",
84+
"picture",
85+
"plaintext",
86+
"popup",
87+
"portal",
88+
"pre",
89+
"progress",
90+
"q",
91+
"rb",
92+
"rp",
93+
"rt",
94+
"rtc",
95+
"ruby",
96+
"s",
97+
"samp",
98+
"section",
99+
"select",
100+
"selectmenu",
101+
"slot",
102+
"small",
103+
"source",
104+
"span",
105+
"strike",
106+
"strong",
107+
"style",
108+
"sub",
109+
"summary",
110+
"sup",
111+
"table",
112+
"tbody",
113+
"td",
114+
"template",
115+
"textarea",
116+
"tfoot",
117+
"th",
118+
"thead",
119+
"time",
120+
"title",
121+
"tr",
122+
"track",
123+
"tt",
124+
"u",
125+
"ul",
126+
"var",
127+
"video",
128+
"wbr",
129+
"xmp"
130+
]

‎src/Symfony/Component/HtmlSanitizer/Tests/Reference/W3CReferenceTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HtmlSanitizer/Tests/Reference/W3CReferenceTest.php
+3-18Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,47 +16,32 @@
1616

1717
/**
1818
* Check that the W3CReference class is up to date with the standard resources.
19-
*
20-
* @see https://github.com/WICG/sanitizer-api/blob/main/resources
2119
*/
2220
class W3CReferenceTest extends TestCase
2321
{
24-
private const STANDARD_RESOURCES = [
25-
'elements' => 'https://raw.githubusercontent.com/WICG/sanitizer-api/main/resources/baseline-element-allow-list.json',
26-
'attributes' => 'https://raw.githubusercontent.com/WICG/sanitizer-api/main/resources/baseline-attribute-allow-list.json',
27-
];
28-
2922
public function testElements()
3023
{
31-
if (!\in_array('https', stream_get_wrappers(), true)) {
32-
$this->markTestSkipped('"https" stream wrapper is not enabled.');
33-
}
34-
3524
$referenceElements = array_values(array_merge(array_keys(W3CReference::HEAD_ELEMENTS), array_keys(W3CReference::BODY_ELEMENTS)));
3625
sort($referenceElements);
3726

3827
$this->assertSame(
39-
$this->getResourceData(self::STANDARD_RESOURCES['elements']),
28+
$this->getResourceData(__DIR__.'/../Fixtures/baseline-element-allow-list.json'),
4029
$referenceElements
4130
);
4231
}
4332

4433
public function testAttributes()
4534
{
46-
if (!\in_array('https', stream_get_wrappers(), true)) {
47-
$this->markTestSkipped('"https" stream wrapper is not enabled.');
48-
}
49-
5035
$this->assertSame(
51-
$this->getResourceData(self::STANDARD_RESOURCES['attributes']),
36+
$this->getResourceData(__DIR__.'/../Fixtures/baseline-attribute-allow-list.json'),
5237
array_keys(W3CReference::ATTRIBUTES)
5338
);
5439
}
5540

5641
private function getResourceData(string $resource): array
5742
{
5843
return json_decode(
59-
file_get_contents($resource, false, stream_context_create(['ssl' => ['verify_peer' => false, 'verify_peer_name' => false]])),
44+
file_get_contents($resource),
6045
true,
6146
512,
6247
\JSON_THROW_ON_ERROR

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.