[wp-trac] [WordPress Trac] #57686: Introduce wp_trigger_error() to compliment _doing_it_wrong()

WordPress Trac noreply at wordpress.org
Mon Sep 11 04:13:51 UTC 2023


#57686: Introduce wp_trigger_error() to compliment _doing_it_wrong()
-------------------------------------------------+-------------------------
 Reporter:  azaozz                               |       Owner:
                                                 |  hellofromTonya
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.4
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  needs-dev-note has-patch has-unit-   |     Focuses:
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by peterwilsoncc):

 If WP is to document that the data should be escaped for potential output,
 then I think the function should simply escape the message. It's one of
 those instances in which WP can protect both developers and users from
 developer mistakes, so those of us working on this ticket should take it.

 Escaping the message can lead to some messy messages in log files but I
 think it's safer to presume that the message will be displayed. As the
 message may contain user data then it's best to treat it unsafe.

 Ideally PHP would escape for debug_display but not for log files but
 unfortunately that's not the case.

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


More information about the wp-trac mailing list