[wp-trac] [WordPress Trac] #37132: tinymce uses php open tag which can crash visual editor when server is set to parse JS files for PHP

WordPress Trac noreply at wordpress.org
Tue Jun 21 07:13:06 UTC 2016


#37132: tinymce uses php open tag which can crash visual editor when server is set
to parse JS files for PHP
-------------------------------+------------------------------
 Reporter:  oldbucsfan         |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  TinyMCE            |     Version:  4.5.2
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Old description:

> When apache is set to parse .js files for PHP (needed in some cases), it
> causes timymce.min.js to return a 500 error. This is because one part of
> the file uses a php open tag "<?":
>
> pi:function(e,t){t?r.push("<?",e,"
> ",s(t),"?>"):r.push("<?",e,"?>"),i&&r.push("\n")}
>
> It would be best if this part of the file was written so that it would
> not return a 500 error if .js files are parsed for PHP. A simple fix:
>
> pi:function(e,t){t?r.push("<"+"?",e,"
> ",s(t),"?"+">"):r.push("<"+"?",e,"?"+">"),i&&r.push("\n")}

New description:

 When apache is set to parse .js files for PHP (needed in some cases), it
 causes `tinymce.min.js` to return a 500 error. This is because one part of
 the file uses a php open tag `"<?"`:

 `pi:function(e,t){t?r.push("<?",e,"
 ",s(t),"?>"):r.push("<?",e,"?>"),i&&r.push("\n")}`

 It would be best if this part of the file was written so that it would not
 return a 500 error if .js files are parsed for PHP. A simple fix:

 `pi:function(e,t){t?r.push("<"+"?",e,"
 ",s(t),"?"+">"):r.push("<"+"?",e,"?"+">"),i&&r.push("\n")}`

--

Comment (by swissspidy):

 It's worth noting that the minified `tinymce.min.js` file is directly
 obtained from upstream, https://www.tinymce.com/.

 Besides that, I agree with johnbillion. If the JS output depends on PHP,
 you should add that part as an inline script instead.

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


More information about the wp-trac mailing list