For the check if the current theme overrides the icons you look for control_panel_default.png in the controlpanel directory under the themes directory:

if (file_exists($theme_path . '/control_panel_default.png')) {
$image_directory = $theme_path;
}

The icon sizes sub directories are not taken into account here. I dont have files in this directory, but in the 48x48 subdirectory.
There should be an additional

variable_get('controlpanel_icon_size', '48x48');

in there, like:

if (file_exists($theme_path . '/' . variable_get('controlpanel_icon_size', '48x48') . '/control_panel_default.png')) {
$image_directory = $theme_path;
}

Comments

dreed47’s picture

Assigned: Unassigned » dreed47
Status: Active » Fixed

fixed and committed

Anonymous’s picture

Status: Fixed » Closed (fixed)