diff --git a/modules/system/system.module b/modules/system/system.module index 4bed9c1..e317254 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -920,7 +920,14 @@ function _system_theme_data() { $themes_info = $themes; } - return $themes_info; + // To avoid side effects, we don't return the original objects + $themes_info_cloned = array(); + // only PHP 5+ knows the "clone" keyword. + // PHP 4 clones objects by itself, unless they are by reference variables. + foreach ($themes_info as $key => $theme) { + $themes_info_cloned[$key] = drupal_clone($theme); + } + return $themes_info_cloned; } /**