[wp-trac] [WordPress Trac] #33058: $wp_filesystem->exists('') returns a wrong answer (when FS_METHOD='ftpext').

WordPress Trac noreply at wordpress.org
Thu Mar 16 23:35:26 UTC 2023


#33058: $wp_filesystem->exists('') returns a wrong answer (when
FS_METHOD='ftpext').
-------------------------------------------------+-------------------------
 Reporter:  Zdrobau                              |       Owner:
                                                 |  SergeyBiryukov
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.3
Component:  Filesystem API                       |     Version:  2.5
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-testing-info commit    |     Focuses:
  needs-docs                                     |
-------------------------------------------------+-------------------------
Changes (by azaozz):

 * keywords:  has-patch has-testing-info commit => has-patch has-testing-
     info commit needs-docs


Comment:

 Replying to [comment:19 costdev]:

 > I'm not sure why someone would want to do an exists on an empty string
 as opposed to the better (IMO) `::exists( ::cwd() )`

 makes sense.

 > - Some documentation in the FTP `::exists()` methods' docblocks might be
 a useful addition here to explain the reasoning.

 Yep, think so too. At least have to mention that doing `::cwd( $path )`
 followed by `::exists('')` would return `false` for consistency with the
 other filesystem methods.

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


More information about the wp-trac mailing list