Eliminate use of `extract()` in `request_filesystem_credentials()`.

The only property that doesn't need to be set to a variable is `$password`.

See #22400.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-05-16 18:26:15 +00:00
parent f184243aa3
commit 8eb9f2ffe4
1 changed files with 9 additions and 6 deletions

View File

@ -1084,11 +1084,13 @@ function request_filesystem_credentials($form_post, $type = '', $error = false,
update_option('ftp_credentials', $stored_credentials);
return $credentials;
}
$hostname = '';
$username = '';
$connection_type = '';
if ( !empty($credentials) )
extract($credentials, EXTR_OVERWRITE);
$hostname = isset( $credentials['hostname'] ) ? $credentials['hostname'] : '';
$username = isset( $credentials['username'] ) ? $credentials['username'] : '';
$public_key = isset( $credentials['public_key'] ) ? $credentials['public_key'] : '';
$private_key = isset( $credentials['private_key'] ) ? $credentials['private_key'] : '';
$port = isset( $credentials['port'] ) ? $credentials['port'] : '';
$connection_type = isset( $credentials[''] ) ? $credentials[''] : '';
if ( $error ) {
$error_string = __('<strong>ERROR:</strong> There was an error connecting to the server, Please verify the settings are correct.');
if ( is_wp_error($error) )
@ -1178,7 +1180,8 @@ jQuery(function($){
<label for="public_key"><?php _e('Public Key:') ?></label ><br />
<label for="private_key"><?php _e('Private Key:') ?></label>
</div></th>
<td><br /><input name="public_key" type="text" id="public_key" value="<?php echo esc_attr($public_key) ?>"<?php disabled( defined('FTP_PUBKEY') ); ?> size="40" /><br /><input name="private_key" type="text" id="private_key" value="<?php echo esc_attr($private_key) ?>"<?php disabled( defined('FTP_PRIKEY') ); ?> size="40" />
<td><br /><input name="public_key" type="text" id="public_key" value="<?php echo esc_attr($public_key) ?>"<?php disabled( defined('FTP_PUBKEY') ); ?> size="40" />
<br /><input name="private_key" type="text" id="private_key" value="<?php echo esc_attr($private_key) ?>"<?php disabled( defined('FTP_PRIKEY') ); ?> size="40" />
<div><?php _e('Enter the location on the server where the keys are located. If a passphrase is needed, enter that in the password field above.') ?></div></td>
</tr>
<?php endif; ?>