WordPress.org

Make WordPress Core

Ticket #37412: 37412.diff

File 37412.diff, 7.3 KB (added by DrewAPicture, 5 years ago)
  • src/wp-admin/includes/class-automatic-upgrader-skin.php

     
    2222        protected $messages = array();
    2323
    2424        /**
     25         * Determines whether the upgrader needs FTP/SSH details in order to connect
     26         * to the filesystem.
    2527         *
    26          * @param bool   $error
    27          * @param string $context
    28          * @param bool   $allow_relaxed_file_ownership
    29          * @return bool
     28         * @since 3.7.0
     29         * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.
     30         *
     31         * @see request_filesystem_credentials()
     32         *
     33         * @param bool   $error                        Optional. Whether the current request has failed to connect.
     34         *                                             Default false.
     35         * @param string $context                      Optional. Full path to the directory that is tested
     36         *                                             for being writable. Default empty.
     37         * @param bool   $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
     38         * @return bool True on success, false on failure.
    3039         */
    3140        public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {
    3241                if ( $context ) {
  • src/wp-admin/includes/class-wp-upgrader-skin.php

     
    5959        }
    6060
    6161        /**
     62         * Displays a form to the user to request for their FTP/SSH details in order
     63         * to connect to the filesystem.
    6264         *
    63          * @param bool   $error
    64          * @param string $context
    65          * @param bool   $allow_relaxed_file_ownership
    66          * @return type
     65         * @since 2.8.0
     66         * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.
     67         *
     68         * @see request_filesystem_credentials()
     69         *
     70         * @param bool   $error                        Optional. Whether the current request has failed to connect.
     71         *                                             Default false.
     72         * @param string $context                      Optional. Full path to the directory that is tested
     73         *                                             for being writable. Default empty.
     74         * @param bool   $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
     75         * @return bool False on failure, true on success.
    6776         */
    68         public function request_filesystem_credentials( $error = false, $context = false, $allow_relaxed_file_ownership = false ) {
     77        public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {
    6978                $url = $this->options['url'];
    7079                if ( ! $context ) {
    7180                        $context = $this->options['context'];
  • src/wp-admin/includes/file.php

     
    957957 *
    958958 * @param array  $args                         Optional. Connection details. Default empty array.
    959959 * @param string $context                      Optional. Full path to the directory that is tested
    960  *                                             for being writable. Default false.
     960 *                                             for being writable. Default empty.
    961961 * @param bool   $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable.
    962962 *                                             Default false.
    963963 * @return string The transport to use, see description for valid return values.
    964964 */
    965 function get_filesystem_method( $args = array(), $context = false, $allow_relaxed_file_ownership = false ) {
     965function get_filesystem_method( $args = array(), $context = '', $allow_relaxed_file_ownership = false ) {
    966966        $method = defined('FS_METHOD') ? FS_METHOD : false; // Please ensure that this is either 'direct', 'ssh2', 'ftpext' or 'ftpsockets'
    967967
    968968        if ( ! $context ) {
     
    10271027 * Displays a form to the user to request for their FTP/SSH details in order
    10281028 * to connect to the filesystem.
    10291029 *
    1030  * All chosen/entered details are saved, Excluding the Password.
     1030 * All chosen/entered details are saved, excluding the password.
    10311031 *
    10321032 * Hostnames may be in the form of hostname:portnumber (eg: wordpress.org:2467)
    10331033 * to specify an alternate FTP/SSH port.
    10341034 *
    1035  * Plugins may override this form by returning true|false via the
    1036  * {@see 'request_filesystem_credentials'} filter.
     1035 * Plugins may override this form by returning true|false via the {@see 'request_filesystem_credentials'} filter.
    10371036 *
    1038  * @since 2.5.
     1037 * @since 2.5.0
     1038 * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.
    10391039 *
    10401040 * @global string $pagenow
    10411041 *
     
    10431043 * @param string $type                         Optional. Chosen type of filesystem. Default empty.
    10441044 * @param bool   $error                        Optional. Whether the current request has failed to connect.
    10451045 *                                             Default false.
    1046  * @param string $context                      Optional. Full path to the directory that is tested
    1047  *                                             for being writable. Default false.
    1048  * @param array  $extra_fields                 Optional. Extra POST fields which should be checked for
    1049  *                                             to be included in the post. Default null.
    1050  * @param bool   $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable.
    1051  *                                             Default false.
     1046 * @param string $context                      Optional. Full path to the directory that is tested for being
     1047 *                                             writable. Default empty.
     1048 * @param array  $extra_fields                 Optional. Extra `POST` fields to be checked for inclusion in
     1049 *                                             the post. Default null.
     1050 * @param bool   $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
    10521051 *
    10531052 * @return bool False on failure, true on success.
    10541053 */
    1055 function request_filesystem_credentials( $form_post, $type = '', $error = false, $context = false, $extra_fields = null, $allow_relaxed_file_ownership = false ) {
     1054function request_filesystem_credentials( $form_post, $type = '', $error = false, $context = '', $extra_fields = null, $allow_relaxed_file_ownership = false ) {
    10561055        global $pagenow;
    10571056
    10581057        /**
     
    10621061         * output of the filesystem credentials form, returning that value instead.
    10631062         *
    10641063         * @since 2.5.0
     1064         * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.
    10651065         *
    10661066         * @param mixed  $output                       Form output to return instead. Default empty.
    10671067         * @param string $form_post                    The URL to post the form to.
     
    11601160         * Filters the connection types to output to the filesystem credentials form.
    11611161         *
    11621162         * @since 2.9.0
     1163         * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.
    11631164         *
    11641165         * @param array  $types       Types of connections.
    11651166         * @param array  $credentials Credentials to connect with.