Skip to content

Commit 1fa84e7

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

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
@@ -5436,6 +5436,9 @@ function iis7_supports_permalinks() {
54365436
* @return int 0 means nothing is wrong, greater than 0 means something was wrong.
54375437
*/
54385438
function validate_file( $file, $allowed_files = array() ) {
5439+
// Normalize path for Windows servers
5440+
$file = wp_normalize_path( $file );
5441+
54395442
// `../` on its own is not allowed:
54405443
if ( '../' === $file ) {
54415444
return 1;

0 commit comments

Comments
 (0)