WordPress.org

Make WordPress Core

Ticket #11152: 11152.diff

File 11152.diff, 1.9 KB (added by dd32, 9 years ago)
  • wp-admin/includes/class-wp-filesystem-ftpext.php

     
    8282
    8383                //Set the Connection to use Passive FTP
    8484                @ftp_pasv( $this->link, true );
    85                 if ( @ftp_get_option($this->link, FTP_TIMEOUT_SEC) < FTP_TIMEOUT )
    86                         @ftp_set_option($this->link, FTP_TIMEOUT_SEC, FTP_TIMEOUT);
     85                if ( @ftp_get_option($this->link, FTP_TIMEOUT_SEC) < FS_TIMEOUT )
     86                        @ftp_set_option($this->link, FTP_TIMEOUT_SEC, FS_TIMEOUT);
    8787
    8888                return true;
    8989        }
  • wp-admin/includes/file.php

     
    738734                unset($credentials['port']);
    739735        }
    740736
    741         if ( defined('FTP_SSH') || (defined('FS_METHOD') && 'ssh' == FS_METHOD) )
     737        if ( (defined('FTP_SSH') && FTP_SSH) || (defined('FS_METHOD') && 'ssh' == FS_METHOD) )
    742738                $credentials['connection_type'] = 'ssh';
    743         else if ( defined('FTP_SSL') && 'ftpext' == $type ) //Only the FTP Extension understands SSL
     739        else if ( (defined('FTP_SSL') && FTP_SSL) && 'ftpext' == $type ) //Only the FTP Extension understands SSL
    744740                $credentials['connection_type'] = 'ftps';
    745741        else if ( !empty($_POST['connection_type']) )
    746742                $credentials['connection_type'] = stripslashes($_POST['connection_type']);
     
    837833<fieldset><legend class="screen-reader-text"><span><?php _e('Connection Type') ?></span></legend>
    838834<?php
    839835
    840         $disabled = defined('FTP_SSL') || defined('FTP_SSH') ? '' : ' disabled="disabled"';
     836        $disabled = (defined('FTP_SSL') && FTP_SSL) || (defined('FTP_SSH') && FTP_SSH) ? ' disabled="disabled"' : '';
    841837
    842838        foreach ( $types as $name => $text ) : ?>
    843839        <label for="<?php echo esc_attr($name) ?>">