mirror of
git://develop.git.wordpress.org/
synced 2025-01-29 10:38:22 +01:00
Upgrade/Install: Sanitize file name in File_Upload_Upgrader
.
Merge of [38524] to the 4.6 branch. git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38525 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ea621b3d5b
commit
4930623000
@ -100,8 +100,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