Make WordPress Core


Ignore:
Timestamp:
02/24/2009 11:39:12 PM (18 years ago)
Author:
azaozz
Message:

Don't use mb_* functions when initializing CodePress, see #9173

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/misc.php

    r10614 r10643  
    283283function codepress_get_lang( $filename ) {
    284284        $codepress_supported_langs = apply_filters( 'codepress_supported_langs',
    285                                                                         array( 'css' => 'css',
    286                                                                                         'js' => 'javascript',
    287                                                                                         'php' => 'php',
    288                                                                                         'html' => 'html',
    289                                                                                         'htm' => 'html',
    290                                                                                         'txt' => 'text'
     285                                                                        array( '.css' => 'css',
     286                                                                                        '.js' => 'javascript',
     287                                                                                        '.php' => 'php',
     288                                                                                        '.html' => 'html',
     289                                                                                        '.htm' => 'html',
     290                                                                                        '.txt' => 'text'
    291291                                                                                        ) );
    292         $extension = mb_substr( $filename, mb_strrpos( $filename, '.' ) + 1 );
    293         return isset( $codepress_supported_langs[$extension] ) ? $codepress_supported_langs[$extension] : 'generic';
     292        $extension = substr( $filename, strrpos( $filename, '.' ) );
     293        if ( $extension && array_key_exists( $extension, $codepress_supported_langs ) )
     294                return $codepress_supported_langs[$extension];
     295       
     296        return 'generic';
    294297}
    295298
    … …  
    306309        ?><script type="text/javascript">
    307310/* <![CDATA[ */
    308 var codepress_path = '<?php echo get_option('home') ?>/wp-includes/js/codepress/';
     311var codepress_path = '<?php echo includes_url('js/codepress/'); ?>';
    309312jQuery('#template').submit(function(){
    310313        if (jQuery('#newcontent_cp').length)
Note: See TracChangeset for help on using the changeset viewer.