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

WordPress Trac noreply at wordpress.org
Thu May 1 13:31:57 UTC 2014


#19945: Bug in ../wp-includes/widgets.php
-------------------------------+-----------------------
 Reporter:  Barti112           |       Owner:  Barti112
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Widgets            |     Version:  3.3.1
 Severity:  normal             |  Resolution:  wontfix
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+-----------------------
Changes (by ocean90):

 * status:  new => closed
 * resolution:   => wontfix
 * milestone:  Awaiting Review =>


Old description:

> in this file there are at some places the following code:
>
> $widget = array_merge($widget, $options);
>
> it is possible that $options is not an array and i become a php-warning.
>
> i think better is to check the arrays before you use this function:
>
> if(is_array($widget) && is_array($options)){
>   $widget = array_merge($widget, $options);
> }

New description:

 in this file there are at some places the following code:

 $widget = array_merge($widget, $options);

 it is possible that $options is not an array and i become a php-warning.

 i think better is to check the arrays before you use this function:

 {{{
 if(is_array($widget) && is_array($options)){
   $widget = array_merge($widget, $options);
 }
 }}}

--

Comment:

 We usually don't silence errors which are produced by developer mistakes.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/19945#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list