[wp-trac] [WordPress Trac] #48689: PHP warnings after updating to WP 5.3: ftp_nlist() and ftp_pwd() expect missing parameters
WordPress Trac
noreply at wordpress.org
Sun Apr 6 09:44:53 UTC 2025
#48689: PHP warnings after updating to WP 5.3: ftp_nlist() and ftp_pwd() expect
missing parameters
-------------------------------------------------+-------------------------
Reporter: Hinjiriyo | Owner: costdev
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: Future
| Release
Component: Filesystem API | Version: 5.3
Severity: minor | Resolution:
Keywords: php80 needs-unit-tests has-patch | Focuses: php-
changes-requested | compatibility
-------------------------------------------------+-------------------------
Comment (by christianmeier):
I believe this bug can be fixed for PHP 8.1 and newer versions, while
keeping compatibility with older PHP versions, by changing $link's PHPDoc
type declaration to this:
{{{#!php
<?php
/**
* @since 2.5.0
* @var FTP\Connection|resource|bool
*/
public $link;
}}}
That way the connect() method wouldn't break when either ftp_ssl_connect
or ftp_connect initialize $link.
https://github.com/WordPress/WordPress/blob/master/wp-admin/includes
/class-wp-filesystem-ftpext.php
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48689#comment:42>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list