[wp-trac] [WordPress Trac] #63865: Replace warning-suppression with error-handler in _wp_can_use_pcre_u

WordPress Trac noreply at wordpress.org
Sat Aug 30 20:52:14 UTC 2025


#63865: Replace warning-suppression with error-handler in _wp_can_use_pcre_u
-------------------------+----------------------
 Reporter:  dmsnell      |       Owner:  dmsnell
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:  6.9
Component:  Charset      |     Version:  trunk
 Severity:  normal       |  Resolution:  fixed
 Keywords:  has-patch    |     Focuses:
-------------------------+----------------------
Changes (by dmsnell):

 * owner:  (none) => dmsnell
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"60694" 60694]:
 {{{
 #!CommitTicketReference repository="" revision="60694"
 Compat: Replace warning-suppression in _wp_can_use_pcre_u()

 This patch replaces the use of the problematic error-suppresssion operator
 with a specific error-handler to catch and report Unicode PCRE support
 without raising the related issues of error-suppression: notably
 conflating errors and failing to prevent completely the logging of the
 warnings.

 In this case, the WPCS rule against using error-suppression was actually
 helpful in pointing out the risk, but the code was left in place with an
 “ignore” comment to silence the violation; this patch addresses the risk
 and removes the need for the comment.

 Developed in https://github.com/WordPress/wordpress-develop/pull/9576
 Discussed in https://core.trac.wordpress.org/ticket/63865

 Follow-up to: [45611].

 Props dmsnell.
 Fixes #63865.
 }}}

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


More information about the wp-trac mailing list