From 75d701ec406011295c4fb0ebee56ffb35e576473 Mon Sep 17 00:00:00 2001 From: azaozz Date: Tue, 24 Feb 2009 23:39:12 +0000 Subject: [PATCH] Don't use mb_* functions when initializing CodePress, see #9173 git-svn-id: http://svn.automattic.com/wordpress/trunk@10643 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/misc.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 8a2261be89..280fcc4219 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -282,15 +282,18 @@ function wp_doc_link_parse( $content ) { **/ function codepress_get_lang( $filename ) { $codepress_supported_langs = apply_filters( 'codepress_supported_langs', - array( 'css' => 'css', - 'js' => 'javascript', - 'php' => 'php', - 'html' => 'html', - 'htm' => 'html', - 'txt' => 'text' + array( '.css' => 'css', + '.js' => 'javascript', + '.php' => 'php', + '.html' => 'html', + '.htm' => 'html', + '.txt' => 'text' ) ); - $extension = mb_substr( $filename, mb_strrpos( $filename, '.' ) + 1 ); - return isset( $codepress_supported_langs[$extension] ) ? $codepress_supported_langs[$extension] : 'generic'; + $extension = substr( $filename, strrpos( $filename, '.' ) ); + if ( $extension && array_key_exists( $extension, $codepress_supported_langs ) ) + return $codepress_supported_langs[$extension]; + + return 'generic'; } /** @@ -305,7 +308,7 @@ function codepress_footer_js() { // CP edits in an iframe, so we need to grab content back into normal form ?>