Make WordPress Core

#58215 closed defect (bug) (invalid)

update_core() does not define $required_php_version and $required_mysql_version global variables

Reported by: upadalavipul's profile upadalavipul Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.3
Component: Upgrade/Install Keywords: close
Focuses: Cc:

Description

I have reviewed the /wp-admin/includes/update-core.php file and found the update_core function used $required_php_version and $required_mysql_version global variables but does not define it in the function.

File Path: trunk/wp-admin/includes/update-core.ph
Function Name: update_core

Attachments (1)

58215.patch (664 bytes) - added by upadalavipul 22 months ago.

Download all attachments as: .zip

Change History (3)

#1 @mukesh27
22 months ago

  • Keywords close added

Hi there! thanks for ticket and patch!

As per https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-admin/includes/update-core.php#L1109-L1115 we don't need to add those global variables.

	/*
	 * Import $wp_version, $required_php_version, and $required_mysql_version from the new version.
	 * DO NOT globalize any variables imported from `version-current.php` in this function.
	 *
	 * BC Note: $wp_filesystem->wp_content_dir() returned unslashed pre-2.8.
	 */
	$versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php';

#2 @SergeyBiryukov
22 months ago

  • Component changed from General to Upgrade/Install
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Summary changed from Does not defined global variable in the function. to update_core() does not define $required_php_version and $required_mysql_version global variables

Hi there, thanks for the ticket!

As noted above, these variables are intentionally imported with a local scope, see [39687] as a follow-up to [31124].

Note: See TracTickets for help on using tickets.