Changeset 11808
- Timestamp:
- 08/13/2009 06:03:26 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/file.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/file.php
r11712 r11808 677 677 678 678 // If defined, set it to that, Else, If POST'd, set it to that, If not, Set it to whatever it previously was(saved details in option) 679 $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? $_POST['hostname']: $credentials['hostname']);680 $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? $_POST['username']: $credentials['username']);681 $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? $_POST['password']: '');679 $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? stripslashes($_POST['hostname']) : $credentials['hostname']); 680 $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? stripslashes($_POST['username']) : $credentials['username']); 681 $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? stripslashes($_POST['password']) : ''); 682 682 683 683 // Check to see if we are setting the public/private keys for ssh 684 $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? $_POST['public_key']: '');685 $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? $_POST['private_key']: '');684 $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? stripslashes($_POST['public_key']) : ''); 685 $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? stripslashes($_POST['private_key']) : ''); 686 686 687 687 //sanitize the hostname, Some people might pass in odd-data: … … 698 698 $credentials['connection_type'] = 'ftps'; 699 699 else if ( !empty($_POST['connection_type']) ) 700 $credentials['connection_type'] = $_POST['connection_type'];700 $credentials['connection_type'] = stripslashes($_POST['connection_type']); 701 701 else if ( !isset($credentials['connection_type']) ) //All else fails (And its not defaulted to something else saved), Default to FTP 702 702 $credentials['connection_type'] = 'ftp'; … … 792 792 793 793 <?php if ( isset( $_POST['version'] ) ) : ?> 794 <input type="hidden" name="version" value="<?php echo esc_attr( $_POST['version']) ?>" />794 <input type="hidden" name="version" value="<?php echo esc_attr(stripslashes($_POST['version'])) ?>" /> 795 795 <?php endif; ?> 796 796 <?php if ( isset( $_POST['locale'] ) ) : ?> 797 <input type="hidden" name="locale" value="<?php echo esc_attr( $_POST['locale']) ?>" />797 <input type="hidden" name="locale" value="<?php echo esc_attr(stripslashes($_POST['locale'])) ?>" /> 798 798 <?php endif; ?> 799 799 <p class="submit">
Note: See TracChangeset
for help on using the changeset viewer.