[wp-trac] [WordPress Trac] #60652: font_dir filter enters an infinite loop if wp_get_upload_dir() is used in the filter callback

WordPress Trac noreply at wordpress.org
Tue Apr 2 22:05:25 UTC 2024


#60652: font_dir filter enters an infinite loop if wp_get_upload_dir() is used in
the filter callback
-------------------------------------------------+-------------------------
 Reporter:  mmaattiiaass                         |       Owner:
                                                 |  peterwilsoncc
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.5.1
Component:  General                              |     Version:  6.5
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-unit-tests has-patch fixed-      |     Focuses:
  major dev-reviewed                             |
-------------------------------------------------+-------------------------

Comment (by peterwilsoncc):

 Replying to [comment:56 azaozz]:
 > Think I see where the misunderstanding comes from. It is **not
 required** to use the `upload_dir` filter in order to upload a font. It is
 only required to pass the correct information/context about where the
 /fonts directory is located, as stated below.
 >
 > > I agree that it would probably be better if an upload context was
 added to the upload handlers and related functions but a ticket for the
 enhancement was not opened during the development of the Fonts API so by
 the time it was committed to beta 1 it was too late to do so.

 What I am saying is that for WordPress 6.5 it is required.

 Opening an enhancement for WordPress 6.6 to introduce an upload context is
 fine but it still needs to be documented how uploading works for WordPress
 6.5 so maintainers are aware of it.

 If you can provide a unit test that shows the filter is not required for
 uploading to 6.5 then we can document that approach instead.

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


More information about the wp-trac mailing list