[wp-trac] [WordPress Trac] #55328: PHP warning on rename() inside download_url() in /wp-admin/includes/file.php

WordPress Trac noreply at wordpress.org
Fri Mar 17 19:11:01 UTC 2023


#55328: PHP warning on rename() inside download_url() in /wp-
admin/includes/file.php
----------------------------+------------------------------
 Reporter:  devbd           |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Filesystem API  |     Version:  5.9
 Severity:  normal          |  Resolution:
 Keywords:  dev-feedback    |     Focuses:
----------------------------+------------------------------

Comment (by johnjamesjacoby):

 Replying to [comment:2 costdev]:
 > Pinging @johnjamesjacoby for thoughts on possibly using `$wp_filesystem`
 methods for `download_url()`.

 I started researching this idea when I saw your mention.

 I love it, and it is achievable. My two concerns are the level-of-effort
 to replace the innards, and being very careful not to introduce unintended
 changes that come from using that API (like showing FTP credential modals,
 redirects, etc...)

 Relative to this, are inconsistencies across the WP Filesystem API
 subclasses for which PHP notices are silenced with `@`. In theory,
 `download_url()` could just do `@rename()` if that's what the Filesystem
 API is doing anyways, etc...

 ----

 IMO – there is more research to do, compile, and share here, but I am
 confident we can address these notices in the short-term, and work towards
 the Filesystem API in the long! 🙌

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


More information about the wp-trac mailing list