[wp-trac] [WordPress Trac] #34745: Call to undefined function wp_generate_password when using `wp_tempnam`

WordPress Trac noreply at wordpress.org
Fri Nov 20 00:58:46 UTC 2015


#34745: Call to undefined function wp_generate_password when using `wp_tempnam`
----------------------------+-----------------------
 Reporter:  migueluy        |       Owner:  dd32
     Type:  defect (bug)    |      Status:  assigned
 Priority:  normal          |   Milestone:  4.4
Component:  Filesystem API  |     Version:  trunk
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+-----------------------

Comment (by dd32):

 In what world would `wp-admin/includes/file.php` be loaded, yet `wp-
 includes/pluggable.php` isn't? - A crazy world, that's what :)

 @migueluy can you please post some more details, such as what plugin, and
 what it is doing?

 The only way this can happen, is if upon plugin inclusion, a plugin is
 loading `wp-admin/includes/file.php` manually and calling `wp_tempnam()`
 immediately.. If so that plugin is doing two main things wrong, 1)
 Performing expensive operations on every pageload, 2) Not waiting until
 `plugins_loaded` (which literally fires after Cache & pluggables are
 loadded directly after plugins load) to do it's stufff.

 I don't like the idea that this will fatal sites, but I don't care that a
 plugin doing the above would break.
 I'm tempted to make `wp_tempnam()` `return false` if it's called that
 early.. the other option of course is less harsh and just not use a random
 folder..

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


More information about the wp-trac mailing list