[wp-trac] [WordPress Trac] #56495: For multi site, The emial content used with sprint and filter wpmu_signup_user_notification_email

WordPress Trac noreply at wordpress.org
Tue Sep 6 06:52:31 UTC 2022


#56495: For multi site, The emial content used with sprint and filter
wpmu_signup_user_notification_email
-----------------------------------------+------------------------------
 Reporter:  kp4net                       |       Owner:  (none)
     Type:  defect (bug)                 |      Status:  assigned
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  General                      |     Version:  6.0.2
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:  multisite
-----------------------------------------+------------------------------

Comment (by kp4net):

 Replying to [comment:4 jrf]:
 > > It's used sprintf function and also used filters in it as well so if
 someone applies this filter and updates the content of the subject with
 any specifiers from the below screenshot it will throw an error as sprintf
 function has only a string to replace but if the someone update content
 with more specifiers will not work.
 >
 > Hi @kp4net, welcome to Trac!
 >
 > I'm trying to understand your issue. If I understand it correctly, a
 plugin or themes which is filtering the phrases used here is returning a
 phrase with additional placeholders, which subsequently leads to errors.
 >
 > Looking at your PR, moving the filters out of the `sprintf()` would not
 be a solution for that. That would just moved the problem to a different
 point in the code flow as it doesn't solve the underlying problem of a
 plugin/theme not doing the filtering correctly.

 Hey @jrf

 Thanks for the quick reply and check.

 Yes, You understood the issue correctly that a plugin or theme which is
 filtering the phrases used here is returning an expression with additional
 placeholders, which subsequently leads to errors.

 As I have checked and tested it with one of my client's sites we are using
 this filter to convert the message content to HTML, and it works fine for
 me. I can not understand your point that the code flow doesn't solve the
 underlying problem as we are already applying this filter next after to
 the sprintf function called and also we pass the necessary
 parameters/arguments in this filter. only the difference is that earlier
 we are passing message content expression with placeholders now in this PR
 we pass message content with replace the placeholders with values of it
 and of course, we are passing the values as well to these filters.

 Thanks.

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


More information about the wp-trac mailing list