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	13 Dec 2007 23:52:10 -0000
@@ -1499,10 +1499,27 @@ function drupal_map_assoc($array, $funct
  *   output of the code.
  */
 function drupal_eval($code) {
+  global $theme_path, $theme_info;
+  
+  // Store current theme path.
+  $temp = $theme_path;
+  
+  // If theme info is not initialized get the path from theme_default.
+  if (!isset($theme_info)) {
+    $theme_path = drupal_get_path('theme', $GLOBALS['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 = $temp;
+  
   return $output;
 }
 
