Editor: Fix Path Traversal issue on Windows in Template-Part Block.

Props xknown.




git-svn-id: https://develop.svn.wordpress.org/trunk@58470 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras 2024-06-24 14:36:22 +00:00
parent 9c022260d6
commit 8ee7211a7a

View File

@ -6199,6 +6199,9 @@ function validate_file( $file, $allowed_files = array() ) {
return 0;
}
// Normalize path for Windows servers
$file = wp_normalize_path( $file );
// `../` on its own is not allowed:
if ( '../' === $file ) {
return 1;