WordPress.org

Make WordPress Core

Changeset 28456


Ignore:
Timestamp:
05/16/2014 06:25:41 PM (7 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/file.php

    r28452 r28456  
    10851085        return $credentials;
    10861086    }
    1087     $hostname = '';
    1088     $username = '';
    1089     $connection_type = '';
    1090     if ( !empty($credentials) )
    1091         extract($credentials, EXTR_OVERWRITE);
     1087    $hostname = isset( $credentials['hostname'] ) ? $credentials['hostname'] : '';
     1088    $username = isset( $credentials['username'] ) ? $credentials['username'] : '';
     1089    $public_key = isset( $credentials['public_key'] ) ? $credentials['public_key'] : '';
     1090    $private_key = isset( $credentials['private_key'] ) ? $credentials['private_key'] : '';
     1091    $port = isset( $credentials['port'] ) ? $credentials['port'] : '';
     1092    $connection_type = isset( $credentials[''] ) ? $credentials[''] : '';
     1093
    10921094    if ( $error ) {
    10931095        $error_string = __('<strong>ERROR:</strong> There was an error connecting to the server, Please verify the settings are correct.');
     
    11791181<label for="private_key"><?php _e('Private Key:') ?></label>
    11801182</div></th>
    1181 <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" />
     1183<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" />
     1184    <br /><input name="private_key" type="text" id="private_key" value="<?php echo esc_attr($private_key) ?>"<?php disabled( defined('FTP_PRIKEY') ); ?> size="40" />
    11821185<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>
    11831186</tr>
Note: See TracChangeset for help on using the changeset viewer.