Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.734 diff -u -p -r1.734 common.inc --- includes/common.inc 12 Dec 2007 14:54:27 -0000 1.734 +++ includes/common.inc 16 Dec 2007 12:57:25 -0000 @@ -1499,10 +1499,27 @@ function drupal_map_assoc($array, $funct * output of the code. */ function drupal_eval($code) { + global $theme_path, $theme_info, $conf; + + // Store current theme path. + $old_theme_path = $theme_path; + + // If theme info is not initialized get the path from theme_default. + if (!isset($theme_info)) { + $theme_path = drupal_get_path('theme', $conf['theme_default']); + } + else { + $theme_path = dirname($theme_info->filename); + } + ob_start(); print eval('?>'. $code); $output = ob_get_contents(); ob_end_clean(); + + // Recover original theme path. + $theme_path = $old_theme_path; + return $output; }