[wp-trac] [WordPress Trac] #51219: Theme editor page showing undefined variable notice

WordPress Trac noreply at wordpress.org
Wed Sep 2 20:18:24 UTC 2020


#51219: Theme editor page showing undefined variable notice
-----------------------------+-----------------------------
 Reporter:  vinayak.anivase  |       Owner:  SergeyBiryukov
     Type:  defect (bug)     |      Status:  accepted
 Priority:  normal           |   Milestone:  5.5.2
Component:  Administration   |     Version:  5.5.1
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:  administration
-----------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * keywords:  dev-feedback =>
 * owner:  (none) => SergeyBiryukov
 * status:  new => accepted
 * milestone:  Awaiting Review => 5.5.2


Comment:

 Hi there, welcome to WordPress Trac! Thanks for the report.

 Just noting that while the `$error` variable could indeed be explicitly
 defined for better readability, that is not the issue here, as the
 variable is already set to an empty string by this line above:
 {{{
 wp_reset_vars( array( 'action', 'error', 'file', 'theme' ) );
 }}}

 The issue was introduced in [48850] / #51073, where this variable is now
 unset before it can be used.

 It looks like the code in `wp-admin/admin-header.php` should use a unique
 or at least a less common variable name, something like `$error_get_last`.

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


More information about the wp-trac mailing list