[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
Mon Aug 7 18:39:49 UTC 2023


#48689: PHP warnings after updating to WP 5.3: ftp_nlist() and ftp_pwd() expect
missing parameters
-------------------------------------------------+-------------------------
 Reporter:  Hinjiriyo                            |       Owner:
                                                 |  adamsilverstein
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.4
Component:  Filesystem API                       |     Version:  5.3
 Severity:  minor                                |  Resolution:
 Keywords:  php80 needs-unit-tests has-patch     |     Focuses:  php-
  needs-testing 2nd-opinion                      |  compatibility
-------------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:25 hellofromTonya]:
 > Should the file link property be documented as `resource|null`? Is
 `null` a valid value?

 I think not, as pretty much all methods of this class operate under an
 assumption that the connection was already initialized in
 `WP_Filesystem()` via `$wp_filesystem->connect()`.

 The only case where `$this->link` is `null` is when the connection was for
 some reason not initialized properly, and that could use some further
 investigation to determine the cause. It could be missing or incorrect
 credentials, like in #58940. So I think `resource` is the correct type
 here, and `null` is not a valid value.

 The same applies to the `WP_Filesystem_SSH2` class too.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48689#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list