diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-admin/includes/class-automatic-upgrader-skin.php --- a/wp/wp-admin/includes/class-automatic-upgrader-skin.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-admin/includes/class-automatic-upgrader-skin.php Tue Dec 15 13:49:49 2020 +0100 @@ -30,19 +30,21 @@ * * @see request_filesystem_credentials() * - * @param bool $error Optional. Whether the current request has failed to connect. - * Default false. - * @param string $context Optional. Full path to the directory that is tested - * for being writable. Default empty. - * @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false. + * @param bool|WP_Error $error Optional. Whether the current request has failed to connect, + * or an error object. Default false. + * @param string $context Optional. Full path to the directory that is tested + * for being writable. Default empty. + * @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false. * @return bool True on success, false on failure. */ public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) { if ( $context ) { $this->options['context'] = $context; } - // TODO: fix up request_filesystem_credentials(), or split it, to allow us to request a no-output version - // This will output a credentials form in event of failure, We don't want that, so just hide with a buffer + /* + * TODO: Fix up request_filesystem_credentials(), or split it, to allow us to request a no-output version. + * This will output a credentials form in event of failure. We don't want that, so just hide with a buffer. + */ ob_start(); $result = parent::request_filesystem_credentials( $error, $context, $allow_relaxed_file_ownership ); ob_end_clean(); @@ -58,8 +60,9 @@ /** * @param string|array|WP_Error $data + * @param mixed ...$args Optional text replacements. */ - public function feedback( $data ) { + public function feedback( $data, ...$args ) { if ( is_wp_error( $data ) ) { $string = $data->get_error_message(); } elseif ( is_array( $data ) ) { @@ -72,8 +75,6 @@ } if ( strpos( $string, '%' ) !== false ) { - $args = func_get_args(); - $args = array_splice( $args, 1 ); if ( ! empty( $args ) ) { $string = vsprintf( $string, $args ); }