[wp-trac] [WordPress Trac] #19945: Bug in ../wp-includes/widgets.php

WordPress Trac wp-trac at lists.automattic.com
Thu Feb 2 21:29:54 UTC 2012


#19945: Bug in ../wp-includes/widgets.php
--------------------------+------------------------------
 Reporter:  Barti112      |       Owner:  Barti112
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Widgets       |     Version:  3.3.1
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |
--------------------------+------------------------------
Changes (by kurtpayne):

 * cc: kpayne@… (added)
 * keywords:   => dev-feedback


Comment:

 I can reproduce this by modfying the `control_options` member after
 construction.  This is a no-no, but because `control_options` is public,
 it's not enforced by design.

 {{{
 #!php
 <?php

 class Foo_Widget extends WP_Widget {
         function __construct() {
                 parent::WP_Widget( 'foo_widget', 'Foo_Widget', array(
                     'description' => 'A Foo Widget'
                 ) );
                 $this->control_options = null;
         }
         /** snip **/
 }
 }}}

 Results:

 {{{
 PHP Warning:  array_merge() [<a href='function.array-merge'>function
 .array-merge</a>]: Argument #2 is not an array in ...\wp-
 includes\widgets.php on line 777
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19945#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list