[wp-trac] [WordPress Trac] #59406: Undefined and unused variable in WP_Test_Stream::mkdir

WordPress Trac noreply at wordpress.org
Thu Oct 12 09:44:01 UTC 2023


#59406: Undefined and unused variable in WP_Test_Stream::mkdir
--------------------------------------+---------------------
 Reporter:  david.binda               |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  6.4
Component:  Build/Test Tools          |     Version:  5.6
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------
Changes (by SergeyBiryukov):

 * version:   => 5.6


Comment:

 Thanks for the ticket! Introduced in [49230] / #42663.

 Replying to [ticket:59406 david.binda]:
 > Since I haven't been able to find a test which would be using the mkdir
 method of the stream wrapper, I'm unable to tell what would be the best
 approach to fix the method, since replacing the `$file` by `$this->file`
 nor by `$plaifile` does not seem to prevent repeated directory creations.

 At a glance, it seems like the intention was to prevent directory creation
 if there is already a file with the same name. However, repeated directory
 creations should probably be prevented too, that would be consistent with
 the PHP `mkdir()` implementation.

 So I think the patch may need some adjustment to do both.

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


More information about the wp-trac mailing list