From d76c931269363e4fcf9a588fc498789876c8d8e8 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 25 Oct 2012 22:31:17 +0000 Subject: [PATCH] Fix wp_basename() for Windows by replacing %5C with /. Props SergeyBiryukov fixes #22138 git-svn-id: https://develop.svn.wordpress.org/trunk@22310 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/formatting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index c9f44947c0..caa8006497 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -3249,7 +3249,7 @@ function sanitize_text_field($str) { * @return string */ function wp_basename( $path, $suffix = '' ) { - return urldecode( basename( str_replace( '%2F', '/', urlencode( $path ) ), $suffix ) ); + return urldecode( basename( str_replace( array( '%2F', '%5C' ), '/', urlencode( $path ) ), $suffix ) ); } /**