Fix warning. fixes #8448

git-svn-id: http://svn.automattic.com/wordpress/trunk@10052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-12-04 23:20:41 +00:00
parent 2780af1189
commit 6a9c462d33

View File

@ -1011,9 +1011,14 @@ function add_option_whitelist( $new_options, $options = '' ) {
}
foreach( $new_options as $page => $keys ) {
foreach( $keys as $key ) {
$pos = array_search( $key, $whitelist_options[ $page ] );
if( $pos === false )
if ( !isset($whitelist_options[ $page ]) || !is_array($whitelist_options[ $page ]) ) {
$whitelist_options[ $page ] = array();
$whitelist_options[ $page ][] = $key;
} else {
$pos = array_search( $key, $whitelist_options[ $page ] );
if ( $pos === false )
$whitelist_options[ $page ][] = $key;
}
}
}
return $whitelist_options;