Skip to content

Commit ea03441

Browse files
committed
Add todo on MIME type parsing
1 parent bcc02ae commit ea03441

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/wp-includes/html-api/class-wp-html-tag-processor.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4083,16 +4083,15 @@ public function is_json_script_tag(): bool {
40834083
* > A JSON MIME type is any MIME type whose subtype ends in "+json" or whose essence
40844084
* > is "application/json" or "text/json".
40854085
*
4086-
* The JSON subtype ending in "+json" is not currently handled due to lack
4087-
* of a MIME type parser.
4086+
* @todo The JSON MIME type handling handles some common cases but when MIME type parsing is available it should be leveraged here.
40884087
*
40894088
* @see https://mimesniff.spec.whatwg.org/#json-mime-type
40904089
*/
40914090
if (
4092-
'application/json' === $type
4093-
|| 'importmap' === $type
4094-
|| 'speculationrules' === $type
4095-
|| 'text/json' === $type
4091+
'importmap' === $type ||
4092+
'speculationrules' === $type ||
4093+
'application/json' === $type ||
4094+
'text/json' === $type
40964095
) {
40974096
return true;
40984097
}

0 commit comments

Comments
 (0)