[wp-trac] [WordPress Trac] #51383: PHP error body class added for suppressed errors

WordPress Trac noreply at wordpress.org
Wed Sep 23 18:27:14 UTC 2020


#51383: PHP error body class added for suppressed errors
----------------------------+-------------------------
 Reporter:  desrosj         |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  5.5.2
Component:  Administration  |    Version:  5.5
 Severity:  normal          |   Keywords:  needs-patch
  Focuses:                  |
----------------------------+-------------------------
 When a PHP error occurs in the admin that is suppressed using the `@`
 operator, the `.php-error` class is still added to the `<body>` even
 though the error will not be output.

 To reproduce, use error suppression on code that invokes an `E_WARNING`
 level error. I discovered this with code calling the `mkdir()` method
 within the `WP_Filesystem_Direct`
 [https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes
 /class-wp-filesystem-direct.php#L533 class for a pre-existing directory].

 `@mkdir( ABSPATH . 'wp-content/themes/' );` should reproduce the issue
 after ensuring nothing else is actively capturing and processing PHP
 errors (such as [https://wordpress.org/plugins/query-monitor/ Query
 Monitor]).

 Follow up to #35155 in 5.5 and #51073 in 5.5.1.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51383>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list