WordPress.org

Make WordPress Core

Ticket #41743: 41743.diff

File 41743.diff, 938 bytes (added by SeBsZ, 2 years ago)
  • src/wp-includes/widgets.php

    From 0911bab41f33c97b27c376b7d3c89bd99bbfa3ca Mon Sep 17 00:00:00 2001
    From: SeBsZ <sebs89@gmail.com>
    Date: Wed, 30 Aug 2017 09:52:07 +0200
    Subject: [PATCH] Fixes #41743 by checking if the specified widget has been
     registered first before trying to access an undefined index
    
    ---
     src/wp-includes/widgets.php | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/src/wp-includes/widgets.php b/src/wp-includes/widgets.php
    index fbbdcf5..11ed07d 100644
    a b function wp_convert_widget_settings($base_name, $option_name, $settings) { 
    10361036function the_widget( $widget, $instance = array(), $args = array() ) {
    10371037        global $wp_widget_factory;
    10381038
     1039        if ( ! ( isset($wp_widget_factory->widgets[$widget]) ) ) {
     1040                return;
     1041        }
     1042
    10391043        $widget_obj = $wp_widget_factory->widgets[$widget];
    10401044        if ( ! ( $widget_obj instanceof WP_Widget ) ) {
    10411045                return;