﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
4910	"Widgets might get ""Array"" as CSS class instead of classname"	f00f	anonymous	"When register_sidebar_widget is called with two parameters only and the second one is an array, like 
{{{
register_sidebar_widget(__('WdgName'), array('WdgClass', 'Method'));
}}}
then the CSS class attribute of the widget will contain 'Array' where it should contain the class_name.

Fix: implode classname if it's an array.

File: widgets.php[[BR]]
Line: Replace line 213 with those two lines:
{{{
$classname_ = is_array($wp_registered_widgets[$id]['classname']) ? implode('_', $wp_registered_widgets[$id]['classname']) : $wp_registered_widgets[$id]['classname'];
$params[0]['before_widget'] = sprintf($params[0]['before_widget'], $id, $classname_);
}}}

Btw: I do know (now) that there is a third parameter to register_sidebar_widget(), but we'd better be save than sorry.

The fix should be absolutely save because only local variable is affected.[[BR]]
Sorry for not providing a diff, how do I create one? (Win32)[[BR]]
Easy fix, please include in 2.3 kthxbye ;)"	defect (bug)	closed	high	2.3	General	2.3	minor	fixed	widgets css class has-patch dev-reviewed	
