Skip to content
Permalink
Browse files

Upgrade/Install: Sanitize file name in `File_Upload_Upgrader`.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
swissspidy committed Sep 6, 2016
1 parent 4131900 commit 54720a14d85bc1197ded7cb09bd3ea790caa0b6e
Showing with 6 additions and 2 deletions.
  1. +5 −1 wp-admin/includes/class-file-upload-upgrader.php
  2. +1 −1 wp-includes/version.php
@@ -100,8 +100,12 @@ public function __construct( $form, $urlholder ) {
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' ) );
}
}
}
@@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-alpha-38523';
$wp_version = '4.7-alpha-38524';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 comments on commit 54720a1

Please sign in to comment.
You can’t perform that action at this time.