From 5be592a9652cc9940bda5376390fd53da8b5aaf2 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sun, 14 Dec 2008 01:12:00 +0000 Subject: [PATCH] Silence warnings when looking for translations for external plugins for TinyMCE, for trunk git-svn-id: https://develop.svn.wordpress.org/trunk@10202 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/post.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 1431f1ddc3..5e182b59d9 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -1161,9 +1161,9 @@ function wp_tiny_mce( $teeny = false ) { if ( ! empty($mce_external_languages) ) { foreach ( $mce_external_languages as $name => $path ) { - if ( is_file($path) && is_readable($path) ) { + if ( @is_file($path) && @is_readable($path) ) { include_once($path); - $ext_plugins .= $strings; + $ext_plugins .= $strings . "\n"; $loaded_langs[] = $name; } } @@ -1184,21 +1184,21 @@ function wp_tiny_mce( $teeny = false ) { if ( function_exists('realpath') ) $path = trailingslashit( realpath($path) ); - if ( is_file($path . $mce_locale . '.js') ) - $strings .= @file_get_contents($path . $mce_locale . '.js'); + if ( @is_file($path . $mce_locale . '.js') ) + $strings .= @file_get_contents($path . $mce_locale . '.js') . "\n"; - if ( is_file($path . $mce_locale . '_dlg.js') ) - $strings .= @file_get_contents($path . $mce_locale . '_dlg.js'); + if ( @is_file($path . $mce_locale . '_dlg.js') ) + $strings .= @file_get_contents($path . $mce_locale . '_dlg.js') . "\n"; if ( 'en' != $mce_locale && empty($strings) ) { - if ( is_file($path . 'en.js') ) { + if ( @is_file($path . 'en.js') ) { $str1 = @file_get_contents($path . 'en.js'); - $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ); + $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ) . "\n"; } - if ( is_file($path . 'en_dlg.js') ) { + if ( @is_file($path . 'en_dlg.js') ) { $str2 = @file_get_contents($path . 'en_dlg.js'); - $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 ); + $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 ) . "\n"; } }