[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 13:47:51 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 changes- | Focuses: php-
requested needs-testing-info | compatibility
-------------------------------------------------+-------------------------
Changes (by SirLouen):
* keywords: php80 needs-unit-tests has-patch changes-requested => php80
needs-unit-tests changes-requested needs-testing-info
Comment:
@johnbillion reply:
> This is my main concern with the suggested patch on this ticket. If
there is a default scenario where these methods can be called prior to a
valid resource link being created, then that should be investigated and
fixed rather than silently returning false from the affected methods.
After 5 years, are there any current steps of reproduction for the current
problematic?
It's interesting that I actually wrote back in the day, FTPext has been
always my bane. This filesystem is problematic and not only needs a clear
revamp, but also a full testing suite with mocking functions to prove
everything right and hunt for more edge cases that are triggering FTP
errors (specially because a lot of functions are using error control
operator unnecessarily (and not recommended in WordPress CS).
Here are my 4 tickets regarding FTP #63173 #63172 #63197 #63201
I've tried to solve some of these issues but if I could have some
reproduction steps for the current situation, I could try to check if my
patches are solving this (specially #63173 and #63197 that solve two major
issues).
Also [https://core.trac.wordpress.org/ticket/48689#comment:34 the
error_missing_link idea] is the way to go here.
@christianmeier reply:
> 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
Particularly, this one #63201 touches that. It will not solve anything
error-wise, but it's very useful to remove all those warnings in the code.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48689#comment:43>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list