From 4e37b2911337c00e3fc0aa922f0df215e1918051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 14 Sep 2004 14:21:31 +0000 Subject: Better theme version check (bug #1023029). --- themes.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'themes.php') diff --git a/themes.php b/themes.php index a210a67439..937708dbf8 100644 --- a/themes.php +++ b/themes.php @@ -88,19 +88,22 @@ if ($handleThemes = opendir($path_to_themes)) { // open themes while (false !== ($PMA_Theme = readdir($handleThemes))) { // get screens if ($PMA_Theme != "." && $PMA_Theme != "..") { $screen_directory = $path_to_themes . $PMA_Theme; - + // check for theme requires/name - unset($theme_name, $theme_version); + unset($theme_name, $theme_generation, $theme_version); @include($path_to_themes . $PMA_Theme . '/info.inc.php'); - + // did it set correctly? - if (!isset($theme_name, $theme_version)) + if (!isset($theme_name, $theme_generation, $theme_version)) continue; // invalid theme - + + if ($theme_generation != PMA_THEME_GENERATION) + continue; // different generation + if ($theme_version < PMA_THEME_VERSION) continue; // too old version - - + + if (is_dir($screen_directory) && @file_exists($screen_directory.'/screen.png')) { // if screen exists then output ?> @@ -116,7 +119,7 @@ if ($handleThemes = opendir($path_to_themes)) { // open themes