From fd76a68a2d18c1bc7a4d348172d11b804f6ab88b Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 23 Mar 2011 18:59:52 +0000 Subject: [PATCH] Bail early in dynamic_sidebar() if there are no sidebars. fixes #14816. git-svn-id: https://develop.svn.wordpress.org/trunk@17545 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/widgets.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 4c6d4f4489..60cfa2f3e9 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -854,6 +854,8 @@ function dynamic_sidebar($index = 1) { } $sidebars_widgets = wp_get_sidebars_widgets(); + if ( empty( $sidebars_widgets ) ) + return false; if ( empty($wp_registered_sidebars[$index]) || !array_key_exists($index, $sidebars_widgets) || !is_array($sidebars_widgets[$index]) || empty($sidebars_widgets[$index]) ) return false;