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

WordPress Trac noreply at wordpress.org
Wed Apr 17 21:31:56 UTC 2024


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

 * keywords:  has-patch dev-feedback needs-testing => needs-testing


Comment:

 Replying to [comment:6 khokansardar]:

 Thanks for the patch. I've been working on a patch too, will probably be
 ready tomorrow. It takes a different approach, removes the nested filters
 completely, which also removes any possibility of infinite loop.

 As I said
 [https://core.trac.wordpress.org/ticket/60835?replyto=6#comment:1 above]
 using nested filters there is not a particularly good idea. It is how a
 plugin may do this. However this is core, there is no need to "filter a
 filter" :)

 BTW, been having some "second thoughts" on that infinite loop caused by
 improper use of a filter. This is a "developer error". Of course there
 will be an infinite loop when you call the parent function from a callback
 (well, it is a little more complex here, but still the same thing: a
 callback should not call its parent function).

 Seems that hiding this kind of developer error doesn't actually help
 anybody. The developer is left wondering why their code doesn't work as
 there is no clue that they did something wrong.

 But it seems too late now. Seems we will have to go along with preventing
 the infinite loop and not letting the developers know that they made a
 mistake.

 In any case, not having a possibility to call the parent function from a
 filter and cause an infinite loop seems best.

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


More information about the wp-trac mailing list