Browse Source

No <install> tag no fun!

Signed-off-by: Suki <[email protected]>
Suki 11 years ago
parent
commit
c1e1cdf967
2 changed files with 6 additions and 0 deletions
  1. 5 0
      Sources/Themes.php
  2. 1 0
      Themes/default/languages/Errors.english.php

+ 5 - 0
Sources/Themes.php

@@ -1485,6 +1485,7 @@ function ThemeInstall()
 			fatal_lang_error('package_theme_upload_error_broken', false, $txt['package_get_error_is_mod']);
 		}
 
+		// Get the theme info.
 		elseif (file_exists($theme_dir . '/theme_info.xml'))
 		{
 			$theme_info = file_get_contents($theme_dir . '/theme_info.xml');
@@ -1497,6 +1498,10 @@ function ThemeInstall()
 			if (!$theme_info_xml->exists('theme-info[0]'))
 				fatal_lang_error('package_get_error_packageinfo_corrupt');
 
+			// Check for compatibility with 2.1 or greater.
+			if (!$theme_info_xml->exists('theme-info/install'))
+				fatal_lang_error('package_get_error_not_compatible');
+
 			$theme_info_xml = $theme_info_xml->path('theme-info[0]');
 			$theme_info_xml = $theme_info_xml->to_array();
 

+ 1 - 0
Themes/default/languages/Errors.english.php

@@ -300,6 +300,7 @@ $txt['package_get_error_is_zero'] = 'Although the package was downloaded to the
 $txt['package_get_error_packageinfo_corrupt'] = 'SMF was unable to find any valid information within the package-info.xml file included within the Package. There may be an error with the modification, or the package may be corrupt.';
 $txt['package_get_error_is_theme'] = 'You can\'t install a Theme from this section, please use the <a href="{MANAGETHEMEURL}">Themes and Layout</a> management page to upload it';
 $txt['package_get_error_is_mod'] = 'You can\'t install a mod from this section, please use the <a href="{MANAGEMODURL}">Package manager</a> page to upload it';
+$txt['package_get_error_not_compatible'] = 'Your theme does not show it has compatibility with SMF 2.1. Please contact the theme author.';
 
 $txt['no_membergroup_selected'] = 'No membergroup selected';
 $txt['membergroup_does_not_exist'] = 'The membergroup doesn\'t exist or is invalid.';