Make WordPress Core


Ignore:
Timestamp:
03/26/2008 03:22:53 AM (18 years ago)
Author:
ryan
Message:

Fixing several problems with TiynMCE, triggering of autosave() on an empty post in Safari 3.1, <br> tags in FF, <object> tag may break if switching from Visual to HTML mode and back several times, little cleanup of the compressor and others. Props azaozz. fixes #6384

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/tinymce/tiny_mce_config.php

    r7489 r7513  
    5959
    6060/*
    61 Setting mce_valid_elements to *[*] skips all of the internal cleanup and can cause problems.
    62 The minimal setting would be -strong/-b[*],-em/-i[*],*[*].
    63 Best is to use the default cleanup by not specifying mce_valid_elements. It contains full set of XHTML 1.0.
    64 If others are needed, mce_extended_valid_elements can be used to add to it, or mce_invalid_elements to remove.
    65 */
    66 $valid_elements = apply_filters('mce_valid_elements', '');
    67 $invalid_elements = apply_filters('mce_invalid_elements', '');
    68 $extended_valid_elements = apply_filters('mce_extended_valid_elements', '');
    69 
    70 /*
    7161The following filter allows localization scripts to change the languages displayed in the spellchecker's drop-down menu.
    7262By default it uses Google's spellchecker API, but can be configured to use PSpell/ASpell if installed on the server.
     
    10595    if ( ! empty($mce_external_languages) ) {
    10696        foreach ( $mce_external_languages as $name => $path ) {
    107             if ( is_readable($path) ) {
     97            if ( is_file($path) && is_readable($path) ) {
    10898                include_once($path);
    10999                $ext_plugins .= $strings;
     
    163153    'apply_source_formatting' => false,
    164154    'remove_linebreaks' => true,
     155    'paste_auto_cleanup_on_paste' => true,
     156    'paste_convert_middot_lists' => true,
     157    'paste_remove_spans' => true,
     158    'paste_remove_styles' => true,
     159    'paste_strip_class_attributes' => 'all',
    165160    'gecko_spellcheck' => true,
    166161    'entities' => '38,amp,60,lt,62,gt',
     
    176171);
    177172
    178 if ( $valid_elements ) $initArray['valid_elements'] = $valid_elements;
    179 if ( $extended_valid_elements ) $initArray['extended_valid_elements'] = $extended_valid_elements;
    180 if ( $invalid_elements ) $initArray['invalid_elements'] = $invalid_elements;
    181 
    182173// For people who really REALLY know what they're doing with TinyMCE
    183 // You can modify initArray to add, remove, change elements of the config before tinyMCE.init
    184 $initArray = apply_filters('tiny_mce_before_init', $initArray); // changed from action to filter
     174// You can modify initArray to add, remove, change elements of the config before tinyMCE.init (changed from action to filter)
     175$initArray = apply_filters('tiny_mce_before_init', $initArray);
     176
     177// Setting "valid_elements", "invalid_elements" and "extended_valid_elements" can be done through "tiny_mce_before_init".
     178// Best is to use the default cleanup by not specifying valid_elements, as TinyMCE contains full set of XHTML 1.0.
    185179
    186180// support for deprecated actions
     
    229223if ( $disk_cache ) {
    230224
    231     $cacheKey = apply_filters('tiny_mce_version', '20080323');
     225    $cacheKey = apply_filters('tiny_mce_version', '20080325');
    232226
    233227    foreach ( $initArray as $v )
     
    308302    $content = gzencode( $content, 9, FORCE_GZIP );
    309303}
     304
     305// Stream to client
     306header( 'Content-Length: ' . strlen($content) );
     307echo $content;
    310308
    311309// Write file
     
    328326        @unlink("$cache_path/$key");
    329327
    330     if ( putFileContents( $cache_file, $content ) && is_readable($cache_file) ) {
    331         $mtime = gmdate( "D, d M Y H:i:s", filemtime($cache_file) ) . " GMT";
    332         header( 'Last-Modified: ' . $mtime );
    333         header( 'Cache-Control: must-revalidate', false );
    334     }
    335 }
    336 
    337 // Stream to client
    338 header( 'Content-Length: ' . strlen($content) );
    339 echo $content;
     328    putFileContents( $cache_file, $content );
     329}
     330
    340331?>
Note: See TracChangeset for help on using the changeset viewer.