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

WordPress Trac noreply at wordpress.org
Thu Oct 19 13:40:37 UTC 2017


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

Comment (by jrchamp):

 Replying to [comment:2 bikecrazyy]:
 > Replying to [comment:1 pross]:
 > > Why not use `microtime()` instead of `time()`
 >
 > There are many ways of fixing it for sure, I choose to just add some
 bytes to the end but you might be able to do microtime, I haven't tested
 to see if it will have a collision in the name but I did test uniqid()

 I think what @pross is saying is that `uniqid()` uses `microtime()`
 internally, so rather than append `uniqid()` to `time()`, it makes more
 sense to remove the redundant `time()` and to instead use either
 `microtime(true)` or `uniqid()`. The primary difference between the two
 options is whether you prefer a decimal or hex string.

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


More information about the wp-trac mailing list