WordPress.org

Make WordPress Core

Ticket #10522: file.php.2.patch

File file.php.2.patch, 953 bytes (added by ntm, 9 years ago)

followed now: 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) (comment in line 678 of file.php)

  • file.php

     
    679679        $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? $_POST['hostname'] : $credentials['hostname']);
    680680        $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? $_POST['username'] : $credentials['username']);
    681681        $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? $_POST['password'] : '');
     682        $credentials['connect_timeout'] = defined('FTP_CONNECT_TIMEOUT') ? FTP_CONNECT_TIMEOUT : (!empty($_POST['connect_timeout']) ? $_POST['connect_timeout'] : $credentials['connect_timeout']);
    682683
    683684        // Check to see if we are setting the public/private keys for ssh
    684685        $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? $_POST['public_key'] : '');