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

Props xknown.



Built from https://develop.svn.wordpress.org/trunk@58470


git-svn-id: http://core.svn.wordpress.org/trunk@57919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2024-06-24 14:38:16 +00:00
parent 5e554da546
commit abc2db829a
2 changed files with 4 additions and 1 deletions

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;

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-beta3-58469';
$wp_version = '6.6-beta3-58470';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.