Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Add explicit global declarations for core variables #8356

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/wp-admin/menu-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*
* @global string $self
*/
global $self;

$self = preg_replace( '|^.*/wp-admin/network/|i', '', $_SERVER['PHP_SELF'] );
$self = preg_replace( '|^.*/wp-admin/|i', '', $self );
$self = preg_replace( '|^.*/plugins/|i', '', $self );
Expand Down
2 changes: 2 additions & 0 deletions src/wp-admin/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
* 6: Icon for top level menu.
*
* @global array $menu
* @global array $submenu
*/
global $menu, $submenu;

$menu[2] = array( __( 'Dashboard' ), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' );

Expand Down
1 change: 1 addition & 0 deletions src/wp-includes/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* @var array
* @global array $shortcode_tags
*/
global $shortcode_tags;
$shortcode_tags = array();

/**
Expand Down
6 changes: 6 additions & 0 deletions src/wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,39 @@
*
* @global string $wp_version
*/
global $wp_version;
$wp_version = '6.8-alpha-59274-src';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
*
* @global int $wp_db_version
*/
global $wp_db_version;
$wp_db_version = 58975;

/**
* Holds the TinyMCE version.
*
* @global string $tinymce_version
*/
global $tinymce_version;
$tinymce_version = '49110-20201110';

/**
* Holds the required PHP version.
*
* @global string $required_php_version
*/
global $required_php_version;
$required_php_version = '7.2.24';

/**
* Holds the names of required PHP extensions.
*
* @global string[] $required_php_extensions
*/
global $required_php_extensions;
$required_php_extensions = array(
'json',
'hash',
Expand All @@ -54,4 +59,5 @@
*
* @global string $required_mysql_version
*/
global $required_mysql_version;
$required_mysql_version = '5.5.5';
Loading