diff -Naur wordpress/wp-includes/theme.php wordpress-new/wp-includes/theme.php
--- wordpress/wp-includes/theme.php     2007-05-21 22:11:27.000000000 +0200
+++ wordpress-new/wp-includes/theme.php 2007-06-26 14:08:24.000000000 +0200
@@ -98,7 +98,12 @@
        $themes = array();
        $wp_broken_themes = array();
        $theme_root = get_theme_root();
+       if (ABSPATH != '/') {
        $theme_loc = str_replace(ABSPATH, '', $theme_root);
+       }
+       else {
+               $theme_loc = $theme_root;
+       }

        // Files in wp-content/themes directory and one subdir down
        $themes_dir = @ dir($theme_root);
