Skip to content

Commit a1f16a6

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

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
@@ -3847,6 +3847,9 @@ function iis7_supports_permalinks() {
38473847
* @return int 0 means nothing is wrong, greater than 0 means something was wrong.
38483848
*/
38493849
function validate_file( $file, $allowed_files = '' ) {
3850+
// Normalize path for Windows servers
3851+
$file = wp_normalize_path( $file );
3852+
38503853
if ( false !== strpos( $file, '..' ) )
38513854
return 1;
38523855

0 commit comments

Comments
 (0)