Index: wp-settings.php
===================================================================
--- wp-settings.php	(revision 13038)
+++ wp-settings.php	(working copy)
@@ -193,7 +193,10 @@
  * @global object $wp_the_query
  * @since 2.0.0
  */
-$wp_the_query =& new WP_Query();
+if ( isset($WP_Query) && class_exists($WP_Query) )
+	$wp_the_query =& new $WP_Query();
+else
+	$wp_the_query =& new WP_Query();
 
 /**
  * Holds the reference to @see $wp_the_query
@@ -215,7 +218,10 @@
  * @global object $wp
  * @since 2.0.0
  */
-$wp =& new WP();
+if ( isset($WP) && class_exists($WP) )
+	$wp =& new $WP();
+else
+	$wp =& new WP();
 
 /**
  * WordPress Widget Factory Object
