diff --git a/install/updates/preconfig.php b/install/updates/preconfig.php index d54a101a..b6c324b9 100644 --- a/install/updates/preconfig.php +++ b/install/updates/preconfig.php @@ -72,17 +72,20 @@ function version_compare2($a, $b) { $x = explode("-", $a[count($a)-1]); $a[count($a)-1] = $x[0]; if (stripos($x[1], 'rc') !== false) { + $a[] = '0'; $a[] = '2'; // rc > dev > svn // number of rc $a[] = substr($x[1], 2); } else if (stripos($x[1], 'dev') !== false) { + $a[] = '0'; $a[] = '1'; // svn < dev < rc // number of dev $a[] = substr($x[1], 3); } // -svn version are deprecated else if (stripos($x[1], 'svn') !== false) { + $a[] = '0'; $a[] = '0'; // svn < dev < rc // number of svn $a[] = substr($x[1], 3); @@ -97,17 +100,20 @@ function version_compare2($a, $b) { $x = explode("-", $b[count($b)-1]); $b[count($b)-1] = $x[0]; if (stripos($x[1], 'rc') !== false) { + $b[] = '0'; $b[] = '2'; // rc > dev > svn // number of rc $b[] = substr($x[1], 2); } else if (stripos($x[1], 'dev') !== false) { + $b[] = '0'; $b[] = '1'; // svn < dev < rc // number of dev $b[] = substr($x[1], 3); } // -svn version are deprecated else if (stripos($x[1], 'svn') !== false) { + $b[] = '0'; $b[] = '0'; // svn < dev < rc // number of svn $b[] = substr($x[1], 3); @@ -118,6 +124,17 @@ function version_compare2($a, $b) { } } + if (count($a) > count($b)) { + if ($a[count($b)-1] == $b[count($b)-1]) { + return -1; + } + } + if (count($b) > count($a)) { + if ($b[count($a)-1] == $a[count($a)-1]) { + return 1; + } + } + foreach ($a as $depth => $aVal) { // iterate over each piece of A if (isset($b[$depth])) { diff --git a/lib/init.php b/lib/init.php index d4e130f5..78094660 100644 --- a/lib/init.php +++ b/lib/init.php @@ -363,11 +363,16 @@ $theme = isset($settings['panel']['default_theme']) ? $settings['panel']['defaul /** * overwrite with customer/admin theme if defined */ -if(isset($userinfo['theme']) && $userinfo['theme'] != $theme) -{ +if (isset($userinfo['theme']) && $userinfo['theme'] != $theme) { $theme = $userinfo['theme']; } +// check for existence of the theme +if (!file_exists('templates/'.$theme.'/index.tpl')) { + // Fallback + $theme = 'Froxlor'; +} + /* * check for custom header-graphic */