CKEditor for WordPress - Version 3.6.2.1

Version Description

  • 14.10.2011 =

    • Add security fix (thx to Julio Potier from http://boiteaweb.fr)
    • Fix to Cannot reply to an existing comment (http://wordpress.org/support/topic/plugin-ckeditor-for-wordpress-v362-cannot-reply-to-an-existing-comment)
    • Fix CKEdtior 3.6.2 Update and qTranslate incompatibility (http://wordpress.org/support/topic/plugin-ckeditor-for-wordpress-ckedtior-362-update-and-qtranslate-incompatibility)
    • Change messages for CKFinder configuration
Download this release

Release Info

Developer michal_cksource
Plugin Icon 128x128 CKEditor for WordPress
Version 3.6.2.1
Comparing to
See all releases

Code changes from version 3.6.2.2 to 3.6.2.1

ckeditor_class.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  class ckeditor_wordpress {
3
- var $version = '3.6.2.2';
4
  var $default_options = array();
5
  var $options = array();
6
  var $ckeditor_path = "";
@@ -15,19 +15,9 @@ class ckeditor_wordpress {
15
  function __construct()
16
  {
17
  $siteurl = trailingslashit(get_option('siteurl'));
18
- if (DEFINED('WP_PLUGIN_URL'))
19
- {
20
- $this->plugin_path = WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)) .'/';
21
- }
22
- else if (DEFINED('WP_PLUGIN_DIR')){
23
- $this->plugin_path = $siteurl .'/'. WP_PLUGIN_DIR . '/' . basename(dirname(__FILE__)) .'/';
24
- }
25
- else{
26
- $this->plugin_path = $siteurl .'wp-content/plugins/' . basename(dirname(__FILE__)) .'/';
27
- }
28
-
29
- define('CKEDITOR_PLUGIN_URL', $this->plugin_path_url);
30
- $this->ckeditor_path = $this->plugin_path .'ckeditor/';
31
  $this->editable_files = array(
32
  'ckeditor.config.js' => dirname(__FILE__).'/ckeditor.config.js',
33
  'ckeditor.styles.js' => dirname(__FILE__).'/ckeditor.styles.js',
@@ -293,7 +283,7 @@ class ckeditor_wordpress {
293
  $ckeditor_plugin_version = $this->version;
294
  $ckfinder_status = $this->ckfinder_status();
295
  if(isset($_POST['reset']) && $_POST['reset']==1){
296
- if (! wp_verify_nonce($_POST['csrf_ckeditor-for-wordpress'], 'ckeditor_create_nonce_overview') || empty($_POST['_wp_http_referer']) || ( isset($_SERVER['HTTP_REFERER']) && !strstr( $_SERVER['HTTP_REFERER'], $_POST['_wp_http_referer']) ) ) wp_die("You do not have sufficient permissions to access this page.");
297
  update_option('ckeditor_wordpress', $this->default_options);
298
  $this->options = $this->default_options;
299
  echo '<div class="updated"><p>' . __('Configuration updated!') . '</p></div>';
@@ -307,7 +297,7 @@ class ckeditor_wordpress {
307
  if (!empty($_POST['submit_update'])) {
308
  $message=array();
309
  /* validation */
310
- if (! wp_verify_nonce($_POST['csrf_ckeditor-for-wordpress'], 'ckeditor_create_nonce_basic') || empty($_POST['_wp_http_referer']) || ( isset($_SERVER['HTTP_REFERER']) && !strstr( $_SERVER['HTTP_REFERER'], $_POST['_wp_http_referer']) ) ) wp_die("You do not have sufficient permissions to access this page.");
311
  $new_options=$_POST['options'];
312
  $new_options['appearance']['comment_editor']=(isset($_POST['options']['appearance']['comment_editor'])?'t':'f');
313
 
@@ -319,7 +309,7 @@ class ckeditor_wordpress {
319
  function upload_options()
320
  {
321
  if (!empty($_POST['submit_update'])) {
322
- if (! wp_verify_nonce($_POST['csrf_ckeditor-for-wordpress'], 'ckeditor_create_nonce_upload') || empty($_POST['_wp_http_referer']) || ( isset($_SERVER['HTTP_REFERER']) && !strstr( $_SERVER['HTTP_REFERER'], $_POST['_wp_http_referer']) ) ) wp_die("You do not have sufficient permissions to access this page.");
323
  $new_options=$_POST['options'];
324
  foreach (array('access', 'fileView', 'fileDelete', 'fileRename', 'fileUpload', 'folderView', 'folderDelete', 'folderCreate', 'folderRename') as $command) {
325
  $this->set_capability($new_options['ckfinder']['permissions'][$command], "ckeditor_ckfinder_".$command);
@@ -384,7 +374,7 @@ class ckeditor_wordpress {
384
 
385
  function advanced_options() {
386
  if (!empty($_POST['submit_update'])) {
387
- if (! wp_verify_nonce($_POST['csrf_ckeditor-for-wordpress'], 'ckeditor_create_nonce_advanced') || empty($_POST['_wp_http_referer']) || ( isset($_SERVER['HTTP_REFERER']) && !strstr( $_SERVER['HTTP_REFERER'], $_POST['_wp_http_referer']) ) ) wp_die("You do not have sufficient permissions to access this page.");
388
  $new_options=$_POST['options'];
389
  $new_options['advanced']['native_spell_checker'] = (isset($_POST['options']['advanced']['native_spell_checker'])?'t':'f');
390
  $new_options['advanced']['scayt_autoStartup'] = (isset($_POST['options']['advanced']['scayt_autoStartup'])?'t':'f');
@@ -440,19 +430,6 @@ class ckeditor_wordpress {
440
  $massage['advanced_load_timeout'] = __('Enter valid load timeout in seconds.', 'ckeditor_wordpress');
441
  }
442
 
443
- /* language settings */
444
- if (!preg_match('#^\d\d$#', trim($new_options['advanced']['language'])) && !preg_match('#^\d\d-\d\d$#', trim($new_options['advanced']['language']))) {
445
- $massage['advanced_language'] = __('Enter a valid language.', 'ckeditor_wordpress');
446
- }
447
-
448
- if ( trim($new_options['advanced']['detect_language_auto']) != 't' && trim($new_options['advanced']['detect_language_auto'] != 'f') ) {
449
- $massage['advanced_detect_language_auto'] = __('Enter a valid auto detect language value.', 'ckeditor_wordpress');
450
- }
451
-
452
- if ( trim($new_options['advanced']['language_direction']) != 'default' && trim($new_options['advanced']['language_direction']) != 'ltr' && trim($new_options['advanced']['language_direction']) != 'rtl') {
453
- $massage['advanced_language_direction'] = __('Enter a valid language direction value.', 'ckeditor_wordpress');
454
- }
455
-
456
  $this->options = $this->update_options($new_options, (empty($message)?false:true));
457
  }
458
  include('includes/advanced.php');
@@ -575,7 +552,7 @@ function add_post_js()
575
  unset($keys);
576
  }
577
  if(isset($_POST['newcontent'])){
578
- if (! wp_verify_nonce($_POST['csrf_ckeditor-for-wordpress'], 'ckeditor_create_nonce_file_editor') || empty($_POST['_wp_http_referer']) || ( isset($_SERVER['HTTP_REFERER']) && !strstr( $_SERVER['HTTP_REFERER'], $_POST['_wp_http_referer']) ) ) wp_die("You do not have sufficient permissions to access this page.");
579
  $fp=fopen($files[$file], 'w');
580
  $content = stripslashes($_POST['newcontent']);
581
  fwrite($fp, stripslashes($_POST['newcontent']));
@@ -642,11 +619,6 @@ function add_post_js()
642
  switch($options['css']['mode']){
643
  case 'theme':
644
  $settings['contentsCss'][] = get_stylesheet_uri();
645
- //fix for default Wordpress theme
646
- if (preg_match('/twenty[\S]+/', get_stylesheet_uri()))
647
- {
648
- $settings['extraCss'] = 'body {background:#FFF; padding: 0 0.5em; }';
649
- }
650
  break;
651
  case 'self':
652
  foreach(explode(',',$options['css']['path']) as $css_path){
@@ -669,28 +641,6 @@ function add_post_js()
669
  break;
670
  }
671
 
672
- if ($options['advanced']['detect_language_auto'] == 'f')
673
- {
674
- $settings['language'] = $options['advanced']['language'];
675
- }
676
-
677
- if (isset($options['advanced']['language_direction'])) {
678
- switch ($options['advanced']['language_direction']) {
679
- case 'default':
680
- if (is_rtl()) {
681
- $settings['contentsLangDirection'] = 'rtl';
682
- }
683
- break;
684
- case 'ltr':
685
- $settings['contentsLangDirection'] = 'ltr';
686
- break;
687
- case 'rtl':
688
- $settings['contentsLangDirection'] = 'rtl';
689
- break;
690
- }
691
- }
692
-
693
-
694
  $output['configuration']=$settings;
695
  $output['configuration']['customConfig'] = $this->plugin_path . 'ckeditor.config.js';
696
  if(!$is_comment){
@@ -796,20 +746,16 @@ function add_post_js()
796
  //filter to change data for wpeditimage plugin before insert/update in database
797
  function ckeditor_insert_post_data_filter( $data , $postarr = null )
798
  {
799
- $content = $data['post_content'];
800
  //change amp; to empty character . This is to create & character before entities like gt; and lt;
801
- //$content = str_replace('amp;' , '', $content);
 
802
  $content = stripslashes($content);
803
  //change " character in caption string for &quot;
804
- //change amp; to empty character . This is to create & character before entities like gt; and lt; in caption string
805
  $pattern = '/caption="(.+)"\]/';
806
  preg_match_all($pattern, $content,$matches);
807
  if (isset($matches[1]))
808
  {
809
-
810
- $content = str_replace($matches[1], str_replace('amp;', '', $matches[1]), $content);
811
  $content = str_replace($matches[1], str_replace('"', '&quot;', $matches[1]), $content);
812
-
813
  }
814
  //save data
815
  $content = addslashes($content);
@@ -881,101 +827,6 @@ function add_post_js()
881
  }
882
  return $buttons;
883
  }
884
- /**
885
- * List of installed CKEditor languages
886
- *
887
- * @return array
888
- */
889
- function ckeditor_load_lang_options() {
890
- $arr = array();
891
-
892
- if (DEFINED('WP_PLUGIN_DIR'))
893
- {
894
- $lang_file = WP_PLUGIN_DIR .'/'. basename(dirname(__FILE__)) .'/ckeditor/lang/_languages.js';
895
- }
896
- else{
897
- $lang_file = '../wp-content/plugins/ckeditor-for-wordpress/ckeditor/lang/_languages.js';
898
- }
899
- if (file_exists($lang_file))
900
- {
901
- $f = fopen($lang_file, 'r');
902
- $file = fread($f, filesize($lang_file));
903
- $tmp = explode('{', $file);
904
- if (isset($tmp[2]))
905
- {
906
- $tmp = explode('}', $tmp[2]);
907
- }
908
- $langs = explode(',', $tmp[0]);
909
- foreach ($langs AS $key => $lang)
910
- {
911
- preg_match("/(\w+-?\w+):'(\w+)'/i",$lang, $matches);
912
- if (isset($matches[1]) && isset($matches[2]))
913
- $arr[$matches[1]] = $matches[2];
914
- }
915
- }
916
-
917
- //oops, we have no information about languages, let's use those available in CKEditor 2.4.3
918
- if (empty($arr)) {
919
- $arr = array(
920
- 'af' => 'Afrikaans',
921
- 'ar' => 'Arabic',
922
- 'bg' => 'Bulgarian',
923
- 'bn' => 'Bengali/Bangla',
924
- 'bs' => 'Bosnian',
925
- 'ca' => 'Catalan',
926
- 'cs' => 'Czech',
927
- 'da' => 'Danish',
928
- 'de' => 'German',
929
- 'el' => 'Greek',
930
- 'en' => 'English',
931
- 'en-au' => 'English (Australia)',
932
- 'en-ca' => 'English (Canadian)',
933
- 'en-uk' => 'English (United Kingdom)',
934
- 'eo' => 'Esperanto',
935
- 'es' => 'Spanish',
936
- 'et' => 'Estonian',
937
- 'eu' => 'Basque',
938
- 'fa' => 'Persian',
939
- 'fi' => 'Finnish',
940
- 'fo' => 'Faroese',
941
- 'fr' => 'French',
942
- 'gl' => 'Galician',
943
- 'he' => 'Hebrew',
944
- 'hi' => 'Hindi',
945
- 'hr' => 'Croatian',
946
- 'hu' => 'Hungarian',
947
- 'it' => 'Italian',
948
- 'ja' => 'Japanese',
949
- 'km' => 'Khmer',
950
- 'ko' => 'Korean',
951
- 'lt' => 'Lithuanian',
952
- 'lv' => 'Latvian',
953
- 'mn' => 'Mongolian',
954
- 'ms' => 'Malay',
955
- 'nb' => 'Norwegian Bokmal',
956
- 'nl' => 'Dutch',
957
- 'no' => 'Norwegian',
958
- 'pl' => 'Polish',
959
- 'pt' => 'Portuguese (Portugal)',
960
- 'pt-br' => 'Portuguese (Brazil)',
961
- 'ro' => 'Romanian',
962
- 'ru' => 'Russian',
963
- 'sk' => 'Slovak',
964
- 'sl' => 'Slovenian',
965
- 'sr' => 'Serbian (Cyrillic)',
966
- 'sr-latn' => 'Serbian (Latin)',
967
- 'sv' => 'Swedish',
968
- 'th' => 'Thai',
969
- 'tr' => 'Turkish',
970
- 'uk' => 'Ukrainian',
971
- 'vi' => 'Vietnamese',
972
- 'zh' => 'Chinese Traditional',
973
- 'zh-cn' => 'Chinese Simplified',
974
- );
975
- }
976
- asort($arr);
977
- return $arr;
978
- }
979
  }
980
  $ckeditor_wordpress = new ckeditor_wordpress();
981
  ?>
1
  <?php
2
  class ckeditor_wordpress {
3
+ var $version = '3.6.2.1';
4
  var $default_options = array();
5
  var $options = array();
6
  var $ckeditor_path = "";
15
  function __construct()
16
  {
17
  $siteurl = trailingslashit(get_option('siteurl'));
18
+ $this->plugin_path = $siteurl .'wp-content/plugins/' . basename(dirname(__FILE__)) .'/';
19
+ define('CKEDITOR_PLUGIN_URL', $this->plugin_path);
20
+ $this->ckeditor_path = $siteurl .'wp-content/plugins/' . basename(dirname(__FILE__)) .'/ckeditor/';
 
 
 
 
 
 
 
 
 
 
21
  $this->editable_files = array(
22
  'ckeditor.config.js' => dirname(__FILE__).'/ckeditor.config.js',
23
  'ckeditor.styles.js' => dirname(__FILE__).'/ckeditor.styles.js',
283
  $ckeditor_plugin_version = $this->version;
284
  $ckfinder_status = $this->ckfinder_status();
285
  if(isset($_POST['reset']) && $_POST['reset']==1){
286
+ if (! wp_verify_nonce($_POST['csrf_ckeditor-for-wordpress'], 'ckeditor_create_nonce_overview') || empty($_POST['_wp_http_referer']) || !strstr( $_SERVER['HTTP_REFERER'], $_POST['_wp_http_referer']) ) wp_die("You do not have sufficient permissions to access this page.");
287
  update_option('ckeditor_wordpress', $this->default_options);
288
  $this->options = $this->default_options;
289
  echo '<div class="updated"><p>' . __('Configuration updated!') . '</p></div>';
297
  if (!empty($_POST['submit_update'])) {
298
  $message=array();
299
  /* validation */
300
+ if (! wp_verify_nonce($_POST['csrf_ckeditor-for-wordpress'], 'ckeditor_create_nonce_basic') || empty($_POST['_wp_http_referer']) || !strstr( $_SERVER['HTTP_REFERER'], $_POST['_wp_http_referer']) ) wp_die("You do not have sufficient permissions to access this page.");
301
  $new_options=$_POST['options'];
302
  $new_options['appearance']['comment_editor']=(isset($_POST['options']['appearance']['comment_editor'])?'t':'f');
303
 
309
  function upload_options()
310
  {
311
  if (!empty($_POST['submit_update'])) {
312
+ if (! wp_verify_nonce($_POST['csrf_ckeditor-for-wordpress'], 'ckeditor_create_nonce_upload') || empty($_POST['_wp_http_referer']) || !strstr( $_SERVER['HTTP_REFERER'], $_POST['_wp_http_referer']) ) wp_die("You do not have sufficient permissions to access this page.");
313
  $new_options=$_POST['options'];
314
  foreach (array('access', 'fileView', 'fileDelete', 'fileRename', 'fileUpload', 'folderView', 'folderDelete', 'folderCreate', 'folderRename') as $command) {
315
  $this->set_capability($new_options['ckfinder']['permissions'][$command], "ckeditor_ckfinder_".$command);
374
 
375
  function advanced_options() {
376
  if (!empty($_POST['submit_update'])) {
377
+ if (! wp_verify_nonce($_POST['csrf_ckeditor-for-wordpress'], 'ckeditor_create_nonce_advanced') || empty($_POST['_wp_http_referer']) || !strstr( $_SERVER['HTTP_REFERER'], $_POST['_wp_http_referer']) ) wp_die("You do not have sufficient permissions to access this page.");
378
  $new_options=$_POST['options'];
379
  $new_options['advanced']['native_spell_checker'] = (isset($_POST['options']['advanced']['native_spell_checker'])?'t':'f');
380
  $new_options['advanced']['scayt_autoStartup'] = (isset($_POST['options']['advanced']['scayt_autoStartup'])?'t':'f');
430
  $massage['advanced_load_timeout'] = __('Enter valid load timeout in seconds.', 'ckeditor_wordpress');
431
  }
432
 
 
 
 
 
 
 
 
 
 
 
 
 
 
433
  $this->options = $this->update_options($new_options, (empty($message)?false:true));
434
  }
435
  include('includes/advanced.php');
552
  unset($keys);
553
  }
554
  if(isset($_POST['newcontent'])){
555
+ if (! wp_verify_nonce($_POST['csrf_ckeditor-for-wordpress'], 'ckeditor_create_nonce_file_editor') || empty($_POST['_wp_http_referer']) || !strstr( $_SERVER['HTTP_REFERER'], $_POST['_wp_http_referer']) ) wp_die("You do not have sufficient permissions to access this page.");
556
  $fp=fopen($files[$file], 'w');
557
  $content = stripslashes($_POST['newcontent']);
558
  fwrite($fp, stripslashes($_POST['newcontent']));
619
  switch($options['css']['mode']){
620
  case 'theme':
621
  $settings['contentsCss'][] = get_stylesheet_uri();
 
 
 
 
 
622
  break;
623
  case 'self':
624
  foreach(explode(',',$options['css']['path']) as $css_path){
641
  break;
642
  }
643
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
644
  $output['configuration']=$settings;
645
  $output['configuration']['customConfig'] = $this->plugin_path . 'ckeditor.config.js';
646
  if(!$is_comment){
746
  //filter to change data for wpeditimage plugin before insert/update in database
747
  function ckeditor_insert_post_data_filter( $data , $postarr = null )
748
  {
 
749
  //change amp; to empty character . This is to create & character before entities like gt; and lt;
750
+ $content = $data['post_content'];
751
+ $content = str_replace('amp;' , '', $content);
752
  $content = stripslashes($content);
753
  //change " character in caption string for &quot;
 
754
  $pattern = '/caption="(.+)"\]/';
755
  preg_match_all($pattern, $content,$matches);
756
  if (isset($matches[1]))
757
  {
 
 
758
  $content = str_replace($matches[1], str_replace('"', '&quot;', $matches[1]), $content);
 
759
  }
760
  //save data
761
  $content = addslashes($content);
827
  }
828
  return $buttons;
829
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
830
  }
831
  $ckeditor_wordpress = new ckeditor_wordpress();
832
  ?>
ckeditor_wordpress.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: CKEditor for WordPress
5
  Plugin URI: http://wordpress.ckeditor.com/
6
  Description: Replaces the default WordPress editor with <a href="http://ckeditor.com/"> CKEditor</a>
7
- Version: 3.6.2.2
8
  Author: CKSource
9
  Author URI: http://cksource.com/
10
  */
@@ -27,8 +27,6 @@ function ckeditor_init(){
27
  add_filter( 'ckeditor_external_plugins', array(&$ckeditor_wordpress, 'ckeditor_wpmore_plugin') );
28
  add_filter( 'ckeditor_buttons', array(&$ckeditor_wordpress, 'ckeditor_wpmore_button') );
29
  add_filter( 'ckeditor_external_plugins', array(&$ckeditor_wordpress, 'ckeditor_wpgallery_plugin') );
30
- add_filter( 'ckeditor_load_lang_options', array(&$ckeditor_wordpress, 'ckeditor_load_lang_options') );
31
-
32
  //add filter to change content before insert/update to database - needed for wpeditimage plugin
33
  add_filter( 'wp_insert_post_data' , array(&$ckeditor_wordpress, 'ckeditor_insert_post_data_filter'));
34
 
4
  Plugin Name: CKEditor for WordPress
5
  Plugin URI: http://wordpress.ckeditor.com/
6
  Description: Replaces the default WordPress editor with <a href="http://ckeditor.com/"> CKEditor</a>
7
+ Version: 3.6.2.1
8
  Author: CKSource
9
  Author URI: http://cksource.com/
10
  */
27
  add_filter( 'ckeditor_external_plugins', array(&$ckeditor_wordpress, 'ckeditor_wpmore_plugin') );
28
  add_filter( 'ckeditor_buttons', array(&$ckeditor_wordpress, 'ckeditor_wpmore_button') );
29
  add_filter( 'ckeditor_external_plugins', array(&$ckeditor_wordpress, 'ckeditor_wpgallery_plugin') );
 
 
30
  //add filter to change content before insert/update to database - needed for wpeditimage plugin
31
  add_filter( 'wp_insert_post_data' , array(&$ckeditor_wordpress, 'ckeditor_insert_post_data_filter'));
32
 
images/compat_logos.jpg DELETED
Binary file
includes/advanced.php CHANGED
@@ -120,67 +120,6 @@
120
  <div class="description"><?php _e('The time to wait (in seconds) to load the full editor code after the page load, if the "ckeditor_basic.js" file is used. If set to zero, the editor is loaded on demand.', 'ckeditor_wordpress') ?></div>
121
  </td>
122
  </tr>
123
- <?php
124
- $langs = apply_filters('ckeditor_load_lang_options', array());
125
- ?>
126
- <tr valign="top">
127
- <th scope="row"><?php _e('Language', 'ckeditor_wordpress')?></th>
128
- <td>
129
- <?php
130
- //var_dump( get_locale());
131
- if (isset($this->options['advanced']['language']))
132
- {
133
- $selected = $this->options['advanced']['language'];
134
- }else{
135
- $selected = (get_locale())? get_locale() : 'en';
136
- }
137
- ?>
138
- <select name="options[advanced][language]">
139
- <?php foreach ($langs AS $key => $lang): ?>
140
- <option value="<?php echo $key?>" <?php if($key == $selected):?>selected="selected"<?php endif;?>><?php echo $lang ?></option>
141
- <?php endforeach; ?>
142
- </select>
143
- <br /><span class="description"><?php _e('The language for the CKEditor user interface.', 'ckeditor_wordpress'); ?></span>
144
- <?php if (isset($message['advanced_language'])): ?><span class="error"><?php echo $message['advanced_language'] ?></span><?php endif; ?>
145
- </td>
146
- </tr>
147
- <?php
148
- if (isset($this->options['advanced']['detect_language_auto']))
149
- {
150
- $auto = $this->options['advanced']['detect_language_auto'];
151
- } else {
152
- $auto = 't';
153
- }
154
- ?>
155
- <tr valign="top">
156
- <th scope="row"><?php _e('Auto-detect language', 'ckeditor_wordpress')?></th>
157
- <td>
158
- <input id="autodetect_enabled" name="options[advanced][detect_language_auto]" type="radio" value="t" <?php if($auto == 't'):?>checked="checked"<?php endif; ?>><label for="autodetect_enabled">Enabled</label> <br/>
159
- <input id="autodetect_disabled" name="options[advanced][detect_language_auto]" type="radio" value="f" <?php if($auto == 'f'):?>checked="checked"<?php endif; ?>><label for="autodetect_disabled"> Disabled</label>
160
- <br /><span class="description"><?php _e('Automatically detect the user language.', 'ckeditor_wordpress'); ?></span>
161
- <?php if (isset($message['advanced_detect_language_auto'])): ?><br/><span class="error"><?php echo $message['advanced_detect_language_auto'] ?></span><?php endif; ?>
162
- </td>
163
- </tr>
164
- <tr valign="top">
165
- <th scope="row"><?php _e('Language direction ', 'ckeditor_wordpress')?></th>
166
- <td>
167
- <?php
168
- if (isset($this->options['advanced']['language_direction']))
169
- {
170
- $selected = $this->options['advanced']['language_direction'];
171
- }else{
172
- $selected = 'default';
173
- }
174
- ?>
175
- <select name="options[advanced][language_direction]">
176
- <option value="default" <?php if($selected == 'default'):?>selected="selected"<?php endif;?>>Get from current locale (default)</option>
177
- <option value="ltr" <?php if($selected == 'ltr'):?>selected="selected"<?php endif;?>>Left-To-Right</option>
178
- <option value="rtl" <?php if($selected == 'rtl'):?>selected="selected"<?php endif;?>>Right-To-Left</option>
179
- </select>
180
- <br /><span class="description"><?php _e('Choose the language direction used in the editing area. Even when CKEditor automatically detects the user language and adjusts its user interface, the editing area is not automatically changed into the LTR or RTL mode. To be able to type LTR (like English) and RTL (like Arabic, Hebrew, Persian) content at the same time, please make sure that the BidiLtr and BidiRtl buttons are enabled in the toolbar.', 'ckeditor_wordpress'); ?></span>
181
- <?php if (isset($message['advanced_language_direction'])): ?><span class="error"><?php echo $message['advanced_language_dierction'] ?></span><?php endif; ?>
182
- </td>
183
- </tr>
184
  </table>
185
  <p class="submit">
186
  <input type="hidden" name="df_submit" value="1" />
120
  <div class="description"><?php _e('The time to wait (in seconds) to load the full editor code after the page load, if the "ckeditor_basic.js" file is used. If set to zero, the editor is loaded on demand.', 'ckeditor_wordpress') ?></div>
121
  </td>
122
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  </table>
124
  <p class="submit">
125
  <input type="hidden" name="df_submit" value="1" />
includes/ckeditor.utils.js CHANGED
@@ -55,7 +55,12 @@ jQuery(document).ready(function () {
55
  if(typeof(window.autosave) != 'undefined'){
56
  autosaveOld = window.autosave;
57
  }
58
-
 
 
 
 
 
59
  if(typeof(window.switchEditors) != 'undefined') {
60
  window.switchEditors.go = function(id, mode) {
61
  if ('tinymce' == mode) {
@@ -82,10 +87,11 @@ jQuery(document).ready(function () {
82
  };
83
  if ( jQuery('#'+ckeditorSettings.textarea_id).length && typeof CKEDITOR.instances[ckeditorSettings.textarea_id] == 'undefined' ) {
84
  CKEDITOR.replace(ckeditorSettings.textarea_id, ckeditorSettings.configuration);
85
- editorCKE = CKEDITOR.instances[ckeditorSettings.textarea_id];
 
86
  }
87
 
88
- window.tinyMCE = tinymce = getTinyMCEObject();
89
  }
90
  }
91
  else {
@@ -97,7 +103,6 @@ jQuery(document).ready(function () {
97
  jQuery("#update-gallery").click(function(){
98
  updateCkeGallery();
99
  });
100
-
101
  });
102
  function ckeditorOn(id) {
103
  if (typeof(id) != 'undefined' && typeof(CKEDITOR.instances[id]) == 'undefined' )
@@ -107,17 +112,9 @@ function ckeditorOn(id) {
107
  jQuery('#edButtonPreview').addClass('active');
108
  jQuery('#edButtonHTML').removeClass('active');
109
  CKEDITOR.replace(id, ckeditorSettings.configuration);
110
- if (typeof ckeditorSettings.configuration['extraCss'] != 'undefined')
111
- {
112
- CKEDITOR.instances[id].addCss(ckeditorSettings.configuration['extraCss']);
113
- }
114
  }
115
  if ( jQuery('#'+ckeditorSettings.textarea_id).length && (typeof(CKEDITOR.instances) == 'undefined' || typeof(CKEDITOR.instances[ckeditorSettings.textarea_id]) == 'undefined' ) && jQuery("#"+ckeditorSettings.textarea_id).parent().parent().attr('id') != 'quick-press') {
116
  CKEDITOR.replace(ckeditorSettings.textarea_id, ckeditorSettings.configuration);
117
- if (typeof ckeditorSettings.configuration['extraCss'] != 'undefined')
118
- {
119
- CKEDITOR.instances[ckeditorSettings.textarea_id].addCss(ckeditorSettings.configuration['extraCss']);
120
- }
121
  if(ckeditorSettings.textarea_id == 'content') {
122
  setUserSetting( 'editor', 'tinymce' );
123
  jQuery('#quicktags').hide();
@@ -215,8 +212,7 @@ function getTinyMCEObject()
215
  }
216
  },
217
  triggerSave : function(param) {
218
- if(typeof(CKEDITOR) != 'undefined' && typeof(editorCKE) != 'undefined')
219
- editorCKE.updateElement();
220
  },
221
  activeEditor : {
222
  isHidden : function (){return false;},
@@ -227,26 +223,8 @@ function getTinyMCEObject()
227
  {
228
  if (command == "mceInsertContent")
229
  {
230
- pattern = /(\[caption.+\])/ig;
231
- if (pattern.test(text))
232
- {
233
- text = text.replace(/&gt;/g, '>');
234
- text = text.replace(/&lt;/g, '<');
235
- pattern = /(<[\w'"=\s]+>([\S\s]+)<\/\S+>)/ig;
236
- text= text.replace(pattern, function(match, cont)
237
- {
238
- cont = cont.replace(/<[\w'"=\s]+>([\S\s]+)<\/\S+>/ig, function(match, cont){
239
- return cont;
240
- });
241
- return cont;
242
- });
243
- text = text.replace(/<br\/>|<br>|<br \>|<br \/ >|<br\/ >/i,'');
244
- text = text.replace(/"/i,'&quot;');
245
- }
246
-
247
- //setTimeout is required in IE8 when inserting Image gallery from an external modal dialog
248
- if (typeof editorCKE == 'undefined') editorCKE = CKEDITOR.instances[ckeditorSettings.textarea_id];
249
- setTimeout(function(){editorCKE.insertHtml(text);}, 0);
250
  }
251
  },
252
  selection : {
55
  if(typeof(window.autosave) != 'undefined'){
56
  autosaveOld = window.autosave;
57
  }
58
+ window.autosave = function () {
59
+ if(typeof(CKEDITOR) != 'undefined' && typeof(editorCKE) != 'undefined'){
60
+ editorCKE.updateElement();
61
+ }
62
+ autosaveOld();
63
+ };
64
  if(typeof(window.switchEditors) != 'undefined') {
65
  window.switchEditors.go = function(id, mode) {
66
  if ('tinymce' == mode) {
87
  };
88
  if ( jQuery('#'+ckeditorSettings.textarea_id).length && typeof CKEDITOR.instances[ckeditorSettings.textarea_id] == 'undefined' ) {
89
  CKEDITOR.replace(ckeditorSettings.textarea_id, ckeditorSettings.configuration);
90
+ //editorCKE = CKEDITOR.instances[ckeditorSettings.textarea_id];
91
+ editorCKE = CKEDITOR.instances['content'];
92
  }
93
 
94
+ window.tinyMCE = getTinyMCEObject();
95
  }
96
  }
97
  else {
103
  jQuery("#update-gallery").click(function(){
104
  updateCkeGallery();
105
  });
 
106
  });
107
  function ckeditorOn(id) {
108
  if (typeof(id) != 'undefined' && typeof(CKEDITOR.instances[id]) == 'undefined' )
112
  jQuery('#edButtonPreview').addClass('active');
113
  jQuery('#edButtonHTML').removeClass('active');
114
  CKEDITOR.replace(id, ckeditorSettings.configuration);
 
 
 
 
115
  }
116
  if ( jQuery('#'+ckeditorSettings.textarea_id).length && (typeof(CKEDITOR.instances) == 'undefined' || typeof(CKEDITOR.instances[ckeditorSettings.textarea_id]) == 'undefined' ) && jQuery("#"+ckeditorSettings.textarea_id).parent().parent().attr('id') != 'quick-press') {
117
  CKEDITOR.replace(ckeditorSettings.textarea_id, ckeditorSettings.configuration);
 
 
 
 
118
  if(ckeditorSettings.textarea_id == 'content') {
119
  setUserSetting( 'editor', 'tinymce' );
120
  jQuery('#quicktags').hide();
212
  }
213
  },
214
  triggerSave : function(param) {
215
+ editorCKE.updateElement();
 
216
  },
217
  activeEditor : {
218
  isHidden : function (){return false;},
223
  {
224
  if (command == "mceInsertContent")
225
  {
226
+ //setTimeout is required in IE8 when inserting Image gallery from an external modal dialog
227
+ setTimeout(function(){editorCKE.insertHtml(text);}, 0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  }
229
  },
230
  selection : {
plugins/wpeditimage/js/editimage.js CHANGED
@@ -427,18 +427,9 @@ wpImage = {
427
  parent = el.getParent();
428
  if ( (id = f.img_classes.value.match( /wp-image-([0-9]{1,6})/ )) && id[1] )
429
  cap_id = 'attachment_'+id[1];
430
- //prevent insert HTML markup in image caption
431
- pattern = /(<[\w'"=\s]+>([\S\s]+)<\/\S+>)/ig;
432
- captionText = f.img_cap.value.replace(pattern, function(match, cont)
433
- {
434
- cont = cont.replace(/<[\w'"=\s]+>([\S\s]+)<\/\S+>/ig, function(match, cont){
435
- return cont;
436
- });
437
- return cont;
438
- });
439
- captionText = captionText.replace(/<br\/>|<br>|<br \>|<br \/ >|<br\/ >/i,'');
440
- captionText = captionText.replace(/"/i,'&quot;');
441
- el.setAttribute('data-cke-caption',' id="'+cap_id+'" align="'+t.align+'" width="'+f.width.value+'" caption="'+window.parent.CKEDITOR.tools.htmlEncode(captionText)+'"');
442
  el.addClass('wp-caption');
443
  el.addClass(t.align);
444
  } else {
427
  parent = el.getParent();
428
  if ( (id = f.img_classes.value.match( /wp-image-([0-9]{1,6})/ )) && id[1] )
429
  cap_id = 'attachment_'+id[1];
430
+ el.setAttribute('data-cke-caption',' id="'+cap_id+'" align="'+t.align+'" width="'+f.width.value+'" caption="'+f.img_cap.value+'"');
431
+ //tmp = window.parent.CKEDITOR.tools.htmlEncode(f.img_cap.value);
432
+ //el.setAttribute('data-cke-caption',' id="'+cap_id+'" align="'+t.align+'" width="'+f.width.value+'" caption="'+tmp+'"');
 
 
 
 
 
 
 
 
 
433
  el.addClass('wp-caption');
434
  el.addClass(t.align);
435
  } else {
plugins/wpgallery/plugin.js CHANGED
@@ -238,6 +238,7 @@ var caption = '';
238
  var dataProcessor = editor.dataProcessor,
239
  dataFilter = dataProcessor && dataProcessor.dataFilter,
240
  htmlFilter = dataProcessor && dataProcessor.htmlFilter;
 
241
  caption = '';
242
  if ( dataFilter )
243
  {
@@ -315,6 +316,7 @@ var caption = '';
315
  //convert img with caption
316
  if (element.attributes && element.attributes['data-cke-caption'])
317
  {
 
318
  //array of allowed attributes
319
  var allowed_attributes = ['src', 'alt', 'title', 'width', 'height', 'class', 'style'];
320
  text = element.attributes['data-cke-caption'];
@@ -344,11 +346,11 @@ var caption = '';
344
  text= text.replace( /\[(.+)\]/g, function( match, cont )
345
  {
346
  cont = cont.replace(/&#39;/g,"'");
347
- //change html entities to < and >
348
- cont = cont.replace(/&lt;/g, '<');
349
- cont = cont.replace(/&gt;/g, '>');
350
  return '[' + cont.replace( /&amp;quot;|&quot;/g, '"' ) + ']';
351
  });
 
 
 
352
  return text;
353
  }
354
  });
238
  var dataProcessor = editor.dataProcessor,
239
  dataFilter = dataProcessor && dataProcessor.dataFilter,
240
  htmlFilter = dataProcessor && dataProcessor.htmlFilter;
241
+ // var caption = '';
242
  caption = '';
243
  if ( dataFilter )
244
  {
316
  //convert img with caption
317
  if (element.attributes && element.attributes['data-cke-caption'])
318
  {
319
+
320
  //array of allowed attributes
321
  var allowed_attributes = ['src', 'alt', 'title', 'width', 'height', 'class', 'style'];
322
  text = element.attributes['data-cke-caption'];
346
  text= text.replace( /\[(.+)\]/g, function( match, cont )
347
  {
348
  cont = cont.replace(/&#39;/g,"'");
 
 
 
349
  return '[' + cont.replace( /&amp;quot;|&quot;/g, '"' ) + ']';
350
  });
351
+ //change html entities to < and >
352
+ text = text.replace(/&lt;/g, '<');
353
+ text = text.replace(/&gt;/g, '>');
354
  return text;
355
  }
356
  });
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: wiktor, michal_cksource, dczepierga, Dean Lee
3
  Tags: post, wysiwyg, CKEditor, FCKeditor, editor, rich text, rte, rich text editor
4
  Requires at least: 2.0
5
  Tested up to: 3.2
6
- Stable tag: 3.6.2.2
7
  This plugin replaces the default WordPress editor with <a href="http://ckeditor.com/">CKEditor</a>.
8
 
9
  == Description ==
@@ -55,19 +55,8 @@ Features:
55
  2. Leave comment through CKEditor
56
  3. Built-in file manager
57
 
58
- == Changelog ==
59
 
60
- = V3.6.2.2 - 29.11.2011 =
61
-
62
- * Fix for form token secure when browser send no http_referer
63
- * Fix for support qTranslate plugin (http://wordpress.org/support/topic/plugin-ckeditor-for-wordpress-cant-insert-image-or-another-html-tag-from-default-wordpress-media-uploader)
64
- * Fix for plugin path (http://wordpress.org/support/topic/plugin_path-doesnt-use-wp_plugin_url)
65
- * Fix for html markups in image caption.
66
- * Fix for html entities in image caption
67
- * Add support for language settings (http://wordpress.org/support/topic/ckeditor-language-same-as-configphp-lang)
68
- * Fix for CSS default Wordpress theme (http://wordpress.org/support/topic/use-theme-css-should-work-fine-with-the-default-theme)
69
- * Fix for JavaScript autosave.init call error (http://wordpress.org/support/topic/plugin-ckeditor-for-wordpress-ckeditor-for-wordpress-and-mailpress)
70
- * Fix for unnecessary change html entities in text. Now it only occurs in shortcodes tags in [] (http://wordpress.org/support/topic/plugin-ckeditor-for-wordpress-using-html-entities-in-the-output)
71
 
72
  = V3.6.2.1 - 14.10.2011 =
73
 
3
  Tags: post, wysiwyg, CKEditor, FCKeditor, editor, rich text, rte, rich text editor
4
  Requires at least: 2.0
5
  Tested up to: 3.2
6
+ Stable tag: 3.6.2.1
7
  This plugin replaces the default WordPress editor with <a href="http://ckeditor.com/">CKEditor</a>.
8
 
9
  == Description ==
55
  2. Leave comment through CKEditor
56
  3. Built-in file manager
57
 
 
58
 
59
+ == Changelog ==
 
 
 
 
 
 
 
 
 
 
60
 
61
  = V3.6.2.1 - 14.10.2011 =
62