Skip to content

Commit 5f650c1

Browse files
committed
Editor: Fix Path Traversal issue on Windows in Template-Part Block.
Merges [58470] to the 4.1 branch. Props xknown, jorbin. git-svn-id: https://develop.svn.wordpress.org/branches/4.1@58501 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 0bbc713 commit 5f650c1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/wp-includes/functions.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3768,6 +3768,9 @@ function iis7_supports_permalinks() {
37683768
* @return int 0 means nothing is wrong, greater than 0 means something was wrong.
37693769
*/
37703770
function validate_file( $file, $allowed_files = '' ) {
3771+
// Normalize path for Windows servers
3772+
$file = wp_normalize_path( $file );
3773+
37713774
if ( false !== strpos( $file, '..' ) )
37723775
return 1;
37733776

0 commit comments

Comments
 (0)