[wp-trac] [WordPress Trac] #60835: Fix and improve handling of uploading of font files

WordPress Trac noreply at wordpress.org
Tue Jun 25 20:00:27 UTC 2024


#60835: Fix and improve handling of uploading of font files
----------------------------------------------------+---------------------
 Reporter:  azaozz                                  |       Owner:  (none)
     Type:  defect (bug)                            |      Status:  new
 Priority:  high                                    |   Milestone:  6.6
Component:  Upload                                  |     Version:  6.5
 Severity:  normal                                  |  Resolution:
 Keywords:  needs-testing has-patch has-unit-tests  |     Focuses:
----------------------------------------------------+---------------------

Comment (by joemcgill):

 @azaozz thank your for the summary, much appreciated.

 > The biggest bug here is that a part of the WP Uploads API can be
 disabled by a plugin.

 Have any issues been reported that show that removing the `font_dir`
 filter is causing critical bugs in production? I'm not aware of any, and
 if not, this doesn't seem like a critical problem to me.

 > As a result from this API change a plugin can remove the font_dir filter
 and the wp-content/uploads/fonts directory completely (fonts will be saved
 mixed with all other files in the uploads directory). This hinders future
 development in WP and is unacceptable imho. For example, having a /fonts
 directory is needed to implement one of the most requested features: be
 able to drop fonts in the /fonts directory and WP recognizes them.

 Again, this seems like an enhancement that is needed in order to support
 future functionality—not something required for 6.6, so it doesn't appear
 to be a blocking issue.

 > Could you please specify what changes exactly?

 Sure! My understanding of the PR is that it modifies the uploads API by
 adding a new parameter to `wp_upload_bits()` so the directory where files
 will be uploaded is directly passed to the function rather than applied as
 a filter. This feels like a significant change to a low level (and
 foundational) API that should be made as part of an enhancement ticket,
 rather than as an implementation detail to a bug fix.

 I think this would be better to go into trunk early so it has time to soak
 given additional changes to this API might be required to support
 additional use cases like the fonts directory.

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


More information about the wp-trac mailing list