File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3845,9 +3845,6 @@ public function set_modifiable_text( string $plaintext_content ): bool {
38453845 ) {
38463846 /*
38473847 * JavaScript can be safely escaped.
3848- * Non-JavaScript script tags have unknown semantics.
3849- *
3850- * @todo consider applying to JSON and importmap script tags as well.
38513848 */
38523849 if ( $ this ->is_javascript_script_tag () ) {
38533850 $ plaintext_content = preg_replace_callback (
@@ -3869,14 +3866,16 @@ static function ( $matches ) {
38693866 );
38703867 } elseif ( $ this ->is_json_script_tag () ) {
38713868 /*
3872- * To JSON escape JSON, the `<` character can be replaced
3873- * everywhere.
3869+ * JSON can be safely escaped.
38743870 */
38753871 $ plaintext_content = strtr (
38763872 $ plaintext_content ,
38773873 array ( '< ' => '\\u003C ' )
38783874 );
38793875 } else {
3876+ /*
3877+ * Other types of script tags cannot be escaped safely.
3878+ */
38803879 return false ;
38813880 }
38823881 }
You can’t perform that action at this time.
0 commit comments