Index: trunk/globals.php =================================================================== diff -u -r1013 -r1016 --- trunk/globals.php (.../globals.php) (revision 1013) +++ trunk/globals.php (.../globals.php) (revision 1016) @@ -1635,5 +1635,8 @@ return defined('DEBUG_MODE') && constant('DEBUG_MODE') == 1 ? 1 : 0; } +function stricmp ($string1, $string2) { + return strcmp(strtolower($string1), strtolower($string2)); +} ?> Index: trunk/admin/include/mainscript.php =================================================================== diff -u -r964 -r1016 --- trunk/admin/include/mainscript.php (.../mainscript.php) (revision 964) +++ trunk/admin/include/mainscript.php (.../mainscript.php) (revision 1016) @@ -277,6 +277,18 @@ } } +function ValidThemeName(name_str) +{ + if (trim(name_str) == '') return false; + var re = new RegExp('^[a-zA-Z0-9_ ]{1,}$'); + if (name_str.match(re)) { + return true; + } + else { + return false; + } +} + function DaysInMonth(month,year) { timeA = new Date(year, month,1); Index: trunk/admin/config/addtheme.php =================================================================== diff -u -r822 -r1016 --- trunk/admin/config/addtheme.php (.../addtheme.php) (revision 822) +++ trunk/admin/config/addtheme.php (.../addtheme.php) (revision 1016) @@ -195,7 +195,7 @@ > - "> + " maxlength="16"> @@ -225,7 +225,7 @@ > - Get("PrimaryTheme") == 1) echo "checked"; ?>> + Get("PrimaryTheme") == 1) echo "checked disabled"; ?>>   Index: trunk/admin/include/tabs.js =================================================================== diff -u -r964 -r1016 --- trunk/admin/include/tabs.js (.../tabs.js) (revision 964) +++ trunk/admin/include/tabs.js (.../tabs.js) (revision 1016) @@ -96,6 +96,9 @@ case 'custom_name': result = ValidCustomName(FieldValue); break; + case 'theme_name': + result = ValidThemeName(FieldValue); + break; } return result; } Index: trunk/kernel/include/theme.php =================================================================== diff -u -r962 -r1016 --- trunk/kernel/include/theme.php (.../theme.php) (revision 962) +++ trunk/kernel/include/theme.php (.../theme.php) (revision 1016) @@ -711,8 +711,8 @@ $rs->Free(); } - $missingThemes=array_diff($HDDThemes,$DBThemes); - $orphanThemes=array_diff($DBThemes,$HDDThemes); + $missingThemes=array_udiff($HDDThemes,$DBThemes,stricmp); + $orphanThemes=array_udiff($DBThemes,$HDDThemes,stricmp); if($orphanThemes) {