Changes from branches/2.7/wp-admin/includes/file.php at r10199 to trunk/wp-admin/includes/file.php at r10150
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/file.php
r10199 r10150 668 668 $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? $_POST['private_key'] : $credentials['private_key']); 669 669 670 //sanitize the hostname, Some people might pass in odd-data:671 $credentials['hostname'] = preg_replace('|\w+://|', '', $credentials['hostname']); //Strip any schemes off672 673 670 if ( strpos($credentials['hostname'], ':') ) 674 671 list( $credentials['hostname'], $credentials['port'] ) = explode(':', $credentials['hostname'], 2); 675 else676 unset($credentials['port']);677 672 678 673 if ( defined('FTP_SSH') || (isset($_POST['connection_type']) && 'ssh' == $_POST['connection_type']) ) … … 685 680 if ( ! $error && !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) { 686 681 $stored_credentials = $credentials; 687 if ( !empty($stored_credentials['port']) ) //save port as part of hostname to simplify above code. 688 $stored_credentials['hostname'] .= ':' . $stored_credentials['port']; 689 690 unset($stored_credentials['password'], $stored_credentials['port'], $stored_credentials['private_key'], $stored_credentials['public_key']); 682 unset($stored_credentials['password'], $stored_credentials['private_key'], $stored_credentials['public_key']); 691 683 update_option('ftp_credentials', $stored_credentials); 692 684 return $credentials;
Note: See TracChangeset
for help on using the changeset viewer.