[wp-trac] [WordPress Trac] #22138: wp_basname wrong on Windows Systems

WordPress Trac wp-trac at lists.automattic.com
Tue Oct 9 14:30:15 UTC 2012


#22138: wp_basname wrong on Windows Systems
--------------------------+------------------------------
 Reporter:  sebber        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Formatting    |     Version:  3.4.2
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |
--------------------------+------------------------------

Comment (by sebber):

 Possible Resolution:

 function wp_basename( $path, $suffix = '' ) {
 $path = str_replace( '\', '/', $path );
 $path = str_replace( '%2F', '/', urlencode( $path ) );
 return urldecode( basename( $path ), $suffix );

 }

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22138#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list