Index: wp-includes/theme.php
===================================================================
--- wp-includes/theme.php	(revision 17521)
+++ wp-includes/theme.php	(working copy)
@@ -170,10 +170,10 @@
  * <b>code</b>, <b>em</b>, and <b>strong</b> elements also allowed.
  *
  * The style.css file must contain theme name, theme URI, and description. The
- * data can also contain author URI, author, template (parent template),
- * version, status, and finally tags. Some of these are not used by WordPress
- * administration panels, but are used by theme directory web sites which list
- * the theme.
+ * data can also contain the WordPress version required, the version tested to,
+ * author URI, author, template (parent template), version, status, and finally
+ * tags. Some of these are not used by WordPress administration panels, but are
+ * used by theme directory web sites which list the theme.
  *
  * @since 1.5.0
  *
@@ -182,6 +182,8 @@
  */
 function get_theme_data( $theme_file ) {
 	$default_headers = array(
+		'Required' => 'WordPress Version Required',
+		'Tested' => 'Tested Up To',
 		'Name' => 'Theme Name',
 		'URI' => 'Theme URI',
 		'Description' => 'Description',
@@ -209,6 +211,10 @@
 	);
 
 	$theme_data = get_file_data( $theme_file, $default_headers, 'theme' );
+	
+	$theme_data['Required'] = wp_kses( $theme_data['Required'], $themes_allowed_tags );
+	
+	$theme_data['Tested'] = wp_kses( $theme_data['Tested'], $themes_allowed_tags );
 
 	$theme_data['Name'] = $theme_data['Title'] = wp_kses( $theme_data['Name'], $themes_allowed_tags );
 
@@ -284,15 +290,17 @@
 		}
 
 		$theme_data = get_theme_data("$theme_root/$theme_file");
+		
+		$wp_version_required  = $theme_data['Required'];
+		$wp_version_tested    = $theme_data['Tested'];
+		$name                 = $theme_data['Name'];
+		$title                = $theme_data['Title'];
+		$description          = wptexturize($theme_data['Description']);
+		$version              = $theme_data['Version'];
+		$author               = $theme_data['Author'];
+		$template             = $theme_data['Template'];
+		$stylesheet           = dirname($theme_file);
 
-		$name        = $theme_data['Name'];
-		$title       = $theme_data['Title'];
-		$description = wptexturize($theme_data['Description']);
-		$version     = $theme_data['Version'];
-		$author      = $theme_data['Author'];
-		$template    = $theme_data['Template'];
-		$stylesheet  = dirname($theme_file);
-
 		$screenshot = false;
 		foreach ( array('png', 'gif', 'jpg', 'jpeg') as $ext ) {
 			if (file_exists("$theme_root/$stylesheet/screenshot.$ext")) {
@@ -301,6 +309,14 @@
 			}
 		}
 
+		/* Test if WordPress Versions have been set for Required and Tested else set to version 0.0 */
+		/* TO-DO: value set to '0.0' for use in comparison tests - change to 'unknown'? */
+		if ( empty( $wp_version_required ) )
+			$wp_version_required = '0.0';
+			
+		if ( empty( $wp_version_tested ) )
+			$wp_version_tested = '0.0';
+
 		if ( empty($name) ) {
 			$name = dirname($theme_file);
 			$title = $name;
@@ -417,6 +433,8 @@
 
 		$theme_roots[$stylesheet] = str_replace( WP_CONTENT_DIR, '', $theme_root );
 		$wp_themes[$name] = array(
+			'Required' => $wp_version_required,
+			'Tested' => $wp_version_tested,
 			'Name' => $name,
 			'Title' => $title,
 			'Description' => $description,
@@ -1879,4 +1897,4 @@
 
 add_action( 'delete_attachment', '_delete_attachment_theme_mod' );
 
-?>
+?>
\ No newline at end of file
