﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
19244,get_theme() function incorrectly assuming $themes is always an array,cgrymala,nacin,"On line 499 of the current /wp-includes/theme.php file, within the get_theme() function, the array_key_exists() function is being run on the $themes variable, which may not always be an array. If it's not an array, the get_theme() function will throw a PHP warning (which, depending on the user's PHP settings, could also throw additional errors about the headers not being able to be set because of previous output).

The $themes variable is populated from the get_themes() function, which may return an array, or may return boolean false (if search_theme_directories() returns false to the get_themes() function).

I would propose that either get_themes() be modified to always return an array, or that get_theme() be modified to check the data type of the $themes variable before attempting to use the array_key_exists() function. I've attached a patch with the latter suggestion implemented. Thanks.",defect (bug),closed,normal,3.4,Themes,3.2.1,normal,fixed,needs-patch,
