[wp-trac] [WordPress Trac] #20119: Use json_encode() to properly encode the translated strings for TinyMCE

WordPress Trac wp-trac at lists.automattic.com
Sat Feb 25 21:29:33 UTC 2012


#20119: Use json_encode() to properly encode the translated strings for TinyMCE
-------------------------+-----------------------
 Reporter:  azaozz       |       Owner:  azaozz
     Type:  enhancement  |      Status:  reopened
 Priority:  normal       |   Milestone:  3.4
Component:  TinyMCE      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+-----------------------

Comment (by azaozz):

 Replying to [comment:2 nacin]:
 > ... If this file is directly referenced, class-wp-editor.php will not be
 enough to prevent a fatal error.

 Yes, perhaps we can remove that and/or add `if ( ! defined('ABSPATH') )
 exit;` to make sure it's never loaded directly.

 In a default TinyMCE configuration `tinymce/langs` would contain all the
 different [locale].js files. However in WP we've always used our
 translation methods and outputted the translated strings from PHP and wp-
 langs.php has always required to run inside WordPress.

 Thinking more about it, the translations function should probably be a
 part of _WP_Editors rather than being in a separate file in
 `tinymce/langs`.

 Regarding installs on servers without JSON compiled into PHP: thinking
 they have already worked that out either by loading class-json.php or by
 updating their PHP installation.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20119#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list