mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-17 20:15:08 +00:00
Upgrade/Install: Sanitize file name in File_Upload_Upgrader
.
Merge of [38524] to the 4.1 branch. Built from https://develop.svn.wordpress.org/branches/4.1@38530 git-svn-id: http://core.svn.wordpress.org/branches/4.1@38471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3d28255a66
commit
0be5d63999
@ -2326,8 +2326,12 @@ class File_Upload_Upgrader {
|
||||
if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) )
|
||||
wp_die( $uploads['error'] );
|
||||
|
||||
$this->filename = $_GET[$urlholder];
|
||||
$this->filename = sanitize_file_name( $_GET[ $urlholder ] );
|
||||
$this->package = $uploads['basedir'] . '/' . $this->filename;
|
||||
|
||||
if ( 0 !== strpos( realpath( $this->package ), realpath( $uploads['basedir'] ) ) ) {
|
||||
wp_die( __( 'Please select a file' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user