• Resolved xu-lihui

    (@xu-lihui)


    Hi.I find a bug.
    In /wp-includes/media.php about line 441.
    The code is:
    $info = pathinfo($file);
    $dir = $info[‘dirname’];
    $ext = $info[‘extension’];
    $name = wp_basename($file, “.$ext”);`

    In my works the $file values :
    $file = ‘D:\wwwroot\9thq-main/wp-content\uploads\slideshow-gallery5.jpg’;
    But the result of $name is : ‘wp-content\uploads\slideshow-gallery5’
    It is not true!

    In my tests, I find that the function wp_basename() is not works very well.
    The code is:
    basename( str_replace( ‘%2F’, ‘/’, urlencode( $path ) )
    It only tranforms ‘/’ but miss the ‘\’;
    It neglects the symbol of the path in windows;

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘function wp_basename is wrong in windows’ is closed to new replies.