WordPress.org

Make WordPress Core

Changeset 38526


Ignore:
Timestamp:
09/06/2016 05:34:00 PM (4 years ago)
Author:
swissspidy
Message:

Upgrade/Install: Sanitize file name in File_Upload_Upgrader.

Merge of [38524] to the 4.5 branch.

Location:
branches/4.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.5

  • branches/4.5/src/wp-admin/includes/class-wp-upgrader.php

    r36995 r38526  
    26602660                wp_die( $uploads['error'] );
    26612661
    2662             $this->filename = $_GET[$urlholder];
     2662            $this->filename = sanitize_file_name( $_GET[ $urlholder ] );
    26632663            $this->package = $uploads['basedir'] . '/' . $this->filename;
     2664
     2665            if ( 0 !== strpos( realpath( $this->package ), realpath( $uploads['basedir'] ) ) ) {
     2666                wp_die( __( 'Please select a file' ) );
     2667            }
    26642668        }
    26652669    }
Note: See TracChangeset for help on using the changeset viewer.