[wp-trac] [WordPress Trac] #60835: Fix and improve handling of uploading of font files
WordPress Trac
noreply at wordpress.org
Tue Jul 9 23:05:34 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.7
Component: Upload | Version: 6.5
Severity: normal | Resolution:
Keywords: needs-testing has-patch has-unit-tests | Focuses:
----------------------------------------------------+---------------------
Comment (by peterwilsoncc):
@youknowriad This is the tl;dr as I see it.
* one of, if not the main goal, of this ticket is to prevent plugin
authors from removing the font directory filter from `uploads_dir`
* the linked PR does this by introducing/extending the uploads API in a
manner that allows plugin authors to bypass the `upload_dir` filter
* I see this as problematic because the `upload_dir` filter is used by
plugins to offload uploads to S3, Azure and other bucket services. This
has been the case for many years.
* I also see this as an API that extends the problem being identified for
font directory uploads
* the suggestion I made very early on during the review process was to
consider introducing `context` to the uploads API to allow for directories
such as `uploads/fonts`. This would improve maintainability without the
issue of bypassing upload offloads.
During the 6.5 RC period I did look at adding context to the uploads API
but didn't push the code as I felt it was too late to extend the APIs.
The ability to remove the font directory filtering was introduced in the
original PR on the Gutenberg repo (the code was refactored but the ability
remained), so making the change is a back-compat break but it may be
acceptable. At worst it will leave files on the server once a font is
deleted in the font library.
In the discussions during the 6.5 cycle it was mentioned that it was
likely additional directories similar to `fonts` would be introduced.
Pascal asked for a make/core post to expand on this. I can not assist with
this as I don't know what is being proposed, the example of AI engines was
given but only in the abstract.
I am on holidays until July 22 and would like to see a make post of what
is being proposed so it can be discussed among all contributors and the
architecture discussed independently of code. This will allow Kira and me
(core tech leads) and Rob and Kai (editor tech leads) to determine the
best approach to refactoring this code in association with other
contributors.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60835#comment:80>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list