close
Skip to content

Commit 170d8b4

Browse files
committed
Widgets: Ensure a widget is registered prior to checking its ID in is_active_widget().
This avoids a possible PHP warning due to an undefined array key. Developed in WordPress/wordpress-develop#10710 Follow-up to [11090], [7080]. Props sageth, josephscott, Ipstenu, mindctrl, westonruter. See #8441, #6023. Fixes #57518. Built from https://develop.svn.wordpress.org/trunk@61466 git-svn-id: https://core.svn.wordpress.org/trunk@60778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent b53c32c commit 170d8b4

4 files changed

Lines changed: 40 additions & 40 deletions

File tree

‎wp-includes/css/dist/index.php‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
'path' => 'list-reusable-blocks/style',
2323
'dependencies' => array('wp-components'),
2424
),
25-
array(
26-
'handle' => 'wp-commands',
27-
'path' => 'commands/style',
28-
'dependencies' => array('wp-components'),
29-
),
3025
array(
3126
'handle' => 'wp-reusable-blocks',
3227
'path' => 'reusable-blocks/style',
@@ -38,15 +33,20 @@
3833
'dependencies' => array('wp-block-editor', 'wp-components'),
3934
),
4035
array(
41-
'handle' => 'wp-widgets',
42-
'path' => 'widgets/style',
43-
'dependencies' => array('wp-block-editor', 'wp-components'),
36+
'handle' => 'wp-commands',
37+
'path' => 'commands/style',
38+
'dependencies' => array('wp-components'),
4439
),
4540
array(
4641
'handle' => 'wp-components',
4742
'path' => 'components/style',
4843
'dependencies' => array(),
4944
),
45+
array(
46+
'handle' => 'wp-widgets',
47+
'path' => 'widgets/style',
48+
'dependencies' => array('wp-block-editor', 'wp-components'),
49+
),
5050
array(
5151
'handle' => 'wp-format-library',
5252
'path' => 'format-library/style',
@@ -57,16 +57,16 @@
5757
'path' => 'block-directory/style',
5858
'dependencies' => array('wp-block-editor', 'wp-components', 'wp-editor'),
5959
),
60-
array(
61-
'handle' => 'wp-customize-widgets',
62-
'path' => 'customize-widgets/style',
63-
'dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-components', 'wp-media-utils', 'wp-preferences', 'wp-widgets'),
64-
),
6560
array(
6661
'handle' => 'wp-media-utils',
6762
'path' => 'media-utils/style',
6863
'dependencies' => array('wp-components'),
6964
),
65+
array(
66+
'handle' => 'wp-customize-widgets',
67+
'path' => 'customize-widgets/style',
68+
'dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-components', 'wp-media-utils', 'wp-preferences', 'wp-widgets'),
69+
),
7070
array(
7171
'handle' => 'wp-edit-widgets',
7272
'path' => 'edit-widgets/style',
@@ -87,14 +87,14 @@
8787
'path' => 'editor/style',
8888
'dependencies' => array('wp-block-editor', 'wp-commands', 'wp-components', 'wp-media-utils', 'wp-patterns', 'wp-preferences'),
8989
),
90-
array(
91-
'handle' => 'wp-edit-site',
92-
'path' => 'edit-site/style',
93-
'dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-commands', 'wp-components', 'wp-editor', 'wp-patterns', 'wp-preferences', 'wp-widgets'),
94-
),
9590
array(
9691
'handle' => 'wp-block-editor',
9792
'path' => 'block-editor/style',
9893
'dependencies' => array('wp-commands', 'wp-components', 'wp-preferences'),
9994
),
95+
array(
96+
'handle' => 'wp-edit-site',
97+
'path' => 'edit-site/style',
98+
'dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-commands', 'wp-components', 'wp-editor', 'wp-patterns', 'wp-preferences', 'wp-widgets'),
99+
),
100100
);

‎wp-includes/js/dist/script-modules/index.php‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,26 @@
77
*/
88

99
return array(
10+
array(
11+
'id' => '@wordpress/interactivity',
12+
'path' => 'interactivity/index',
13+
'asset' => 'interactivity/index.min.asset.php',
14+
),
15+
array(
16+
'id' => '@wordpress/abilities',
17+
'path' => 'abilities/index',
18+
'asset' => 'abilities/index.min.asset.php',
19+
),
20+
array(
21+
'id' => '@wordpress/latex-to-mathml',
22+
'path' => 'latex-to-mathml/index',
23+
'asset' => 'latex-to-mathml/index.min.asset.php',
24+
),
25+
array(
26+
'id' => '@wordpress/latex-to-mathml/loader',
27+
'path' => 'latex-to-mathml/loader',
28+
'asset' => 'latex-to-mathml/loader.min.asset.php',
29+
),
1030
array(
1131
'id' => '@wordpress/a11y',
1232
'path' => 'a11y/index',
@@ -22,31 +42,11 @@
2242
'path' => 'interactivity-router/full-page',
2343
'asset' => 'interactivity-router/full-page.min.asset.php',
2444
),
25-
array(
26-
'id' => '@wordpress/abilities',
27-
'path' => 'abilities/index',
28-
'asset' => 'abilities/index.min.asset.php',
29-
),
3045
array(
3146
'id' => '@wordpress/core-abilities',
3247
'path' => 'core-abilities/index',
3348
'asset' => 'core-abilities/index.min.asset.php',
3449
),
35-
array(
36-
'id' => '@wordpress/interactivity',
37-
'path' => 'interactivity/index',
38-
'asset' => 'interactivity/index.min.asset.php',
39-
),
40-
array(
41-
'id' => '@wordpress/latex-to-mathml',
42-
'path' => 'latex-to-mathml/index',
43-
'asset' => 'latex-to-mathml/index.min.asset.php',
44-
),
45-
array(
46-
'id' => '@wordpress/latex-to-mathml/loader',
47-
'path' => 'latex-to-mathml/loader',
48-
'asset' => 'latex-to-mathml/loader.min.asset.php',
49-
),
5050
array(
5151
'id' => '@wordpress/route',
5252
'path' => 'route/index',

‎wp-includes/version.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '7.0-alpha-61465';
19+
$wp_version = '7.0-alpha-61466';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

‎wp-includes/widgets.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ function is_active_widget( $callback = false, $widget_id = false, $id_base = fal
925925
if ( is_array( $widgets ) ) {
926926
foreach ( $widgets as $widget ) {
927927
if ( ( $callback && isset( $wp_registered_widgets[ $widget ]['callback'] ) && $wp_registered_widgets[ $widget ]['callback'] === $callback ) || ( $id_base && _get_widget_id_base( $widget ) === $id_base ) ) {
928-
if ( ! $widget_id || $widget_id === $wp_registered_widgets[ $widget ]['id'] ) {
928+
if ( ! $widget_id || ( isset( $wp_registered_widgets[ $widget ]['id'] ) && $widget_id === $wp_registered_widgets[ $widget ]['id'] ) ) {
929929
return $sidebar;
930930
}
931931
}

0 commit comments

Comments
 (0)