[wp-trac] [WordPress Trac] #49292: Fix javascript error caused by incorrectly escaped url

WordPress Trac noreply at wordpress.org
Sun Jan 26 08:58:52 UTC 2020


#49292: Fix javascript error caused by incorrectly escaped url
--------------------------+------------------------------
 Reporter:  juliastri     |       Owner:  juliastri
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  5.3.2
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  javascript
--------------------------+------------------------------

Comment (by juliastri):

 Replying to [ticket:49292 juliastri]:
 > This error message appears in the console on all pages in wp-admin:
 >
 > {{{
 > Uncaught SyntaxError: missing ) after argument list
 > }}}
 >
 > It is caused by this line, as seen in the browser console:
 >
 >
 > {{{
 > <script>
 > ( "fetch" in window ) || document.write( "<script
 src="http://wv5.local.com/wp-includes/js/dist/vendor/wp-polyfill-
 fetch.min.js?ver=3.0.0"></scr" + "ipt>" );( document.contains ) ||
 document.write( "<script src="http://wv5.local.com/wp-
 includes/js/dist/vendor/wp-polyfill-node-
 contains.min.js?ver=3.26.0-0"></scr" + "ipt>" );( window.FormData &&
 window.FormData.prototype.keys ) || document.write( "<script
 src="http://wv5.local.com/wp-includes/js/dist/vendor/wp-polyfill-
 formdata.min.js?ver=3.0.12"></scr" + "ipt>" );( Element.prototype.matches
 && Element.prototype.closest ) || document.write( "<script
 src="http://wv5.local.com/wp-includes/js/dist/vendor/wp-polyfill-element-
 closest.min.js?ver=2.0.2"></scr" + "ipt>" );
 > </script>
 > }}}


 **Note:**
 I know how to fix it.
 The problem is in wp-includes/script-loader.php file where the escaped
 string inside $polyfill is not rendered correctly.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49292#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list