[wp-trac] [WordPress Trac] #42265: get_filesystem_method() isn't unique enough

WordPress Trac noreply at wordpress.org
Fri Nov 24 03:06:59 UTC 2017


#42265: get_filesystem_method() isn't unique enough
----------------------------+------------------------------------------
 Reporter:  bikecrazyy      |       Owner:  dd32
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:  5.0
Component:  Filesystem API  |     Version:  2.5
 Severity:  normal          |  Resolution:  fixed
 Keywords:  has-patch       |     Focuses:  administration, performance
----------------------------+------------------------------------------

Comment (by dd32):

 The change in [42224] is slightly different from
 [attachment:42265_2.patch]
  - `wp_tempnam()` only uses the basename of the `$filename` so the extra
 entropy of the microtime was being discarded. It's also suffixed with
 `wp_generate_password(6)` so just `uniqid()` is unique enough in that
 case.
  - `get_filesystem_method()` previously used an extension-less file, and
 I'd prefer to keep that behaviour for now, so the `.` is replaced with `-`
 to ensure that the file has no extension. While I can't think of any issue
 it'd have caused, I'd rather not be generating temporary files with random
 numeric extensions.

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


More information about the wp-trac mailing list