WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 3 months ago

Last modified 4 weeks ago

#46952 closed defect (bug) (fixed)

$allowed_constants is not defined in class-wp-site-health-auto-updates.php

Reported by: diddledan Owned by: SergeyBiryukov
Milestone: 5.2 Priority: normal
Severity: normal Version: 5.2
Component: Site Health Keywords: site-health
Focuses: administration Cc:

Description

In the file wp-admin/includes/class-wp-site-health-auto-updates.php line 69 a test is made against the variable $allowed_constants which is guaranteed to be undefined because it is not set within the function nor is it pulled via global. This is the only reference within the entire WordPress source code to a variable with this name, so even if we add global it will still be undefined unless a plugin or theme defines it.

https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-site-health-auto-updates.php#L69

Change History (3)

#1 @SergeyBiryukov
3 months ago

  • Component changed from General to Administration
  • Focuses administration added
  • Keywords site-health added
  • Milestone changed from Awaiting Review to 5.2

#2 @SergeyBiryukov
3 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 45223:

Site Health: Remove reference to an undefined variable in WP_Site_Health_Auto_Updates::test_constants().

Props diddledan.
Fixes #46952.

#3 @spacedmonkey
4 weeks ago

  • Component changed from Administration to Site Health
Note: See TracTickets for help on using tickets.