File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -3865,9 +3865,19 @@ static function ( $matches ) {
38653865 $ plaintext_content
38663866 );
38673867 } elseif ( $ this ->is_json_script_tag () ) {
3868- /*
3868+ /**
38693869 * JSON can be safely escaped.
3870+ *
3871+ * The following replacement may appear insuficcient, "<" is replaced
3872+ * with its JSON escape sequence "\u003C" without considering whether
3873+ * the "<" is preceded by an escaping slash. JSON does not support
3874+ * arbitrary character escaping (like JavaScript strings) so "\<"
3875+ * is invalid JSON and would have to be preceded by
3876+ * an escaped backslash: "\\<".
3877+ *
3878+ * @see https://www.json.org/json-en.html
38703879 */
3880+
38713881 $ plaintext_content = strtr (
38723882 $ plaintext_content ,
38733883 array ( '< ' => '\\u003C ' )
You can’t perform that action at this time.
0 commit comments