WordPress.org

Ready to get started?Download WordPress

Forums

WP Email Capture
[resolved] Bug: Undefined index: widget_title/widget_text & attribute_escape is deprecated (2 posts)

  1. Ov3rfly
    Member
    Posted 9 months ago #

    With define('WP_DEBUG', true); in wp-config.php some errors can be observed on WordPress Widgets page if plugin widget is used:

    Notice: Undefined index: widget_title in /../wp-content/plugins/wp-email-capture/inc/widget.php on line 55
    Notice: attribute_escape is deprecated since version 2.8! Use esc_attr() instead in /../wp-includes/functions.php on line 2841
    [..]
    Notice: Undefined index: widget_text in /../wp-content/plugins/wp-email-capture/inc/widget.php on line 56
    Notice: attribute_escape is deprecated since version 2.8! Use esc_attr() instead in /../wp-includes/functions.php on line 2841

    Reasons are wrong indexes title and text in default-array in file wp-email-capture/inc/widget.php, line 48

    Wrong:

    $default = array( 'title' =>  __('Subscribe!','WPEC'), 'text' =>  __('Subscribe to my blog for updates','WPEC')  );

    Suggested fix:

    $default = array( 'widget_title' =>  __('Subscribe!','WPEC'), 'widget_text' =>  __('Subscribe to my blog for updates','WPEC')  );

    and deprecated use of attribute_escape() call in file wp-email-capture/inc/widget.php, starting at line 55

    Wrong:

    echo "\r\n".'<p><label for="'.$title_id.'">'.__('Widget title:','WPEC').': <input type="text" class="widefat" id="'.$title_id.'" name="'.$title_name.'" value="'.attribute_escape( $instance['widget_title'] ).'" /><label></p>';
    echo "\r\n".'<p><label for="'.$text_id.'">'.__('Widget text:','WPEC').': <input type="text" class="widefat" id="'.$text_id.'" name="'.$text_name .'" value="'.attribute_escape( $instance['widget_text'] ).'" /><label></p>';

    Suggested fix:

    echo "\r\n".'<p><label for="'.$title_id.'">'.__('Widget title:','WPEC').': <input type="text" class="widefat" id="'.$title_id.'" name="'.$title_name.'" value="'.esc_attr( $instance['widget_title'] ).'" /><label></p>';
    echo "\r\n".'<p><label for="'.$text_id.'">'.__('Widget text:','WPEC').': <input type="text" class="widefat" id="'.$text_id.'" name="'.$text_name .'" value="'.esc_attr( $instance['widget_text'] ).'" /><label></p>';

    http://wordpress.org/extend/plugins/wp-email-capture/

  2. Rhys Wynne
    Member
    Plugin Author

    Posted 9 months ago #

    Resolved as it's been updated in 2.7.7

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.