Make WordPress Core

Changeset 10734


Ignore:
Timestamp:
03/06/2009 04:17:57 PM (15 years ago)
Author:
azaozz
Message:

Don't use mb_* functions to match file extension, fixes #9289

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/plugin-editor.php

    r10627 r10734  
    9292    if ( ! $error ) {
    9393        $content = file_get_contents( $real_file );
    94        
    95         if ( 'php' == mb_substr( $real_file, mb_strrpos( $real_file, '.' ) + 1 ) ) {
     94
     95        if ( '.php' == substr( $real_file, strrpos( $real_file, '.' ) ) ) {
    9696            $functions = wp_doc_link_parse( $content );
    97            
     97
    9898            $docs_select = '<select name="docs-list" id="docs-list">';
    9999            $docs_select .= '<option value="">' . __( 'Function Name...' ) . '</option>';
     
    103103            $docs_select .= '</select>';
    104104        }
    105        
     105
    106106        $content = htmlspecialchars( $content );
    107107        $codepress_lang = codepress_get_lang($real_file);
  • trunk/wp-admin/theme-editor.php

    r10614 r10734  
    8484    update_recently_edited($file);
    8585
    86     if (!is_file($real_file))
     86    if ( !is_file($real_file) )
    8787        $error = 1;
    8888
    89     if (!$error && filesize($real_file) > 0) {
     89    if ( !$error && filesize($real_file) > 0 ) {
    9090        $f = fopen($real_file, 'r');
    9191        $content = fread($f, filesize($real_file));
    9292
    93         if ( 'php' == mb_substr( $real_file, mb_strrpos( $real_file, '.' ) + 1 ) ) {
     93        if ( '.php' == substr( $real_file, strrpos( $real_file, '.' ) ) ) {
    9494            $functions = wp_doc_link_parse( $content );
    95            
     95
    9696            $docs_select = '<select name="docs-list" id="docs-list">';
    9797            $docs_select .= '<option value="">' . __( 'Function Name...' ) . '</option>';
    98             foreach ( $functions as $function) {                   
     98            foreach ( $functions as $function ) {
    9999                $docs_select .= '<option value="' . urlencode( $function ) . '">' . htmlspecialchars( $function ) . '()</option>';
    100100            }
Note: See TracChangeset for help on using the changeset viewer.