mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-01 00:27:38 +02:00
Dead code in wp-admin/includes/file.php
:
* In `wp_handle_upload()` and `wp_handle_sideload()`, `$ext` gets conditionally reset... and then is never used. * In `request_filesystem_credentials()`, `$password` is initialized as an empty string. The variable is never used. See #27882. Built from https://develop.svn.wordpress.org/trunk@28268 git-svn-id: http://core.svn.wordpress.org/trunk@28096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6295631a4b
commit
644024dfc4
@ -294,9 +294,6 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) {
|
||||
if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
|
||||
return call_user_func($upload_error_handler, $file, __( 'Sorry, this file type is not permitted for security reasons.' ));
|
||||
|
||||
if ( !$ext )
|
||||
$ext = ltrim(strrchr($file['name'], '.'), '.');
|
||||
|
||||
if ( !$type )
|
||||
$type = $file['type'];
|
||||
} else {
|
||||
@ -434,9 +431,6 @@ function wp_handle_sideload( &$file, $overrides = false, $time = null ) {
|
||||
if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
|
||||
return $upload_error_handler( $file, __( 'Sorry, this file type is not permitted for security reasons.' ));
|
||||
|
||||
if ( !$ext )
|
||||
$ext = ltrim(strrchr($file['name'], '.'), '.');
|
||||
|
||||
if ( !$type )
|
||||
$type = $file['type'];
|
||||
}
|
||||
@ -1062,7 +1056,6 @@ function request_filesystem_credentials($form_post, $type = '', $error = false,
|
||||
}
|
||||
$hostname = '';
|
||||
$username = '';
|
||||
$password = '';
|
||||
$connection_type = '';
|
||||
if ( !empty($credentials) )
|
||||
extract($credentials, EXTR_OVERWRITE);
|
||||
|
Loading…
Reference in New Issue
Block a user