--- system.module Thu Jan 15 10:14:12 1970 +++ system.module Thu Jan 15 10:14:12 1970 @@ -920,7 +920,19 @@ $themes_info = $themes; } - return $themes_info; + // To avoid side effects, we don't return the original objects + if (version_compare(PHP_VERSION, '5.0.0', '>')) { + $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] = clone $theme; + } + return $themes_info_cloned; + } + else { + return $themes_info; + } } /**