[wp-trac] [WordPress Trac] #58121: WP_Filesystem_SSH2::put_contents() assumes that PHP's file_put_contents() always returns in int

WordPress Trac noreply at wordpress.org
Wed Apr 12 19:14:36 UTC 2023


#58121: WP_Filesystem_SSH2::put_contents() assumes that PHP's file_put_contents()
always returns in int
----------------------------+------------------------------
 Reporter:  pbiron          |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Filesystem API  |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+------------------------------

Comment (by afragen):

 From [https://www.php.net/manual/en/function.file-put-contents.php|
 php.net:file_put_contents]

 > This function returns the number of bytes that were written to the file,
 or false on failure.
 >
 > Warning
 > This function may return Boolean false, but may also return a non-
 Boolean value which evaluates to false. Please read the section on
 Booleans for more information. Use the === operator for testing the return
 value of this function.

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


More information about the wp-trac mailing list