diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index 1fbfa99e4c..c54384e742 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -196,6 +196,7 @@ class WP_Upgrader { /* translators: %s: Directory name. */ $this->strings['fs_no_folder'] = __( 'Unable to locate needed folder (%s).' ); + $this->strings['no_package'] = __( 'Package not available.' ); $this->strings['download_failed'] = __( 'Download failed.' ); $this->strings['installing_package'] = __( 'Installing the latest version…' ); $this->strings['no_files'] = __( 'The package contains no files.' ); @@ -527,7 +528,10 @@ class WP_Upgrader { set_time_limit( 300 ); } - if ( empty( $source ) || empty( $destination ) ) { + if ( + ( ! is_string( $source ) || '' === $source || trim( $source ) !== $source ) || + ( ! is_string( $destination ) || '' === $destination || trim( $destination ) !== $destination ) + ) { return new WP_Error( 'bad_request', $this->strings['bad_request'] ); } $this->skin->feedback( 'installing_package' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 5a64e4d883..f034d44edd 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-alpha-58021'; +$wp_version = '6.6-alpha-58022'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.