#7222 closed defect (bug) (fixed)
array_merge() error in wp-includes/widgets.php
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.6.1 | Priority: | normal |
Severity: | normal | Version: | 2.5.1 |
Component: | General | Keywords: | widgets has-patch tested commit |
Focuses: | Cc: |
Description
Certain installations of WordPress 2.5.1 in a php5 environment experience errors similar to the below:
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /path/to/wp-includes/widgets.php on line 60
This often occurs in installations where the server upgraded from php4.x to php5.x.
This is almost certainly related to a plugin issue, and the first step to resolve should be to ensure all plugins have been upgraded to their latest stable releases (check the author homepage if necessary to ensure). If this does not resolve, the following will:
On the line noted (usually 60), find the code:
$sidebar = array_merge($defaults, $args);
The fix is to change the code to:
$sidebar = array_merge($defaults, (array)$args);
Adds type casting to the variable to prevent error. Based off of r8534