diff --git a/lib/import/zipimportstorage.inc.php b/lib/import/zipimportstorage.inc.php index 3a24f3c..690085d 100644 --- a/lib/import/zipimportstorage.inc.php +++ b/lib/import/zipimportstorage.inc.php @@ -55,7 +55,7 @@ class KTZipImportStorage extends KTFSImportStorage { var $aFile = array(); - var $allowed_extensions = array('tgz', 'tar', 'gz', 'gzip', 'zip', 'deb', 'ar'); + var $allowed_extensions = array('tgz', 'tar', 'gz', 'zip', 'deb', 'ar'); function KTZipImportStorage($sFilesName) { $this->aFile = $_FILES[$sFilesName]; @@ -63,7 +63,7 @@ class KTZipImportStorage extends KTFSImportStorage { // Check the bzip2 lib functions are available if(function_exists('bzopen')){ - $this->allowed_extensions = array_merge($this->allowed_extensions, array('bz2', 'bzip2', 'tbz')); + $this->allowed_extensions = array_merge($this->allowed_extensions, array('bz2', 'tbz')); } } @@ -116,6 +116,13 @@ class KTZipImportStorage extends KTFSImportStorage { mkdir($sTmpPath, 0700); $this->sBasePath = $sTmpPath; + // Set environment language to output character encoding + $sOutputEncoding = $oKTConfig->get('export/encoding', 'UTF-8'); + $loc = $sOutputEncoding; + putenv("LANG=$loc"); + putenv("LANGUAGE=$loc"); + $loc = setlocale(LC_ALL, $loc); + // File Archive doesn't unzip properly so sticking to the original unzip functionality if($this->sExtension == 'zip'){ // ** Original zip functionality diff --git a/login.php b/login.php index e0da592..98e735a 100644 --- a/login.php +++ b/login.php @@ -165,8 +165,20 @@ class LoginPageDispatcher extends KTDispatcher { $aRegisteredLangs = $oReg->geti18nLanguages('knowledgeTree'); $aLanguageNames = $oReg->getLanguages('knowledgeTree'); $aRegisteredLanguageNames = array(); - foreach (array_keys($aRegisteredLangs) as $sLang) { - $aRegisteredLanguageNames[$sLang] = $aLanguageNames[$sLang]; + + if (empty($aRegisteredLangs)) + { + $query = "DELETE FROM plugin_helper"; + DBUtil::runQuery($query); + redirect($_SERVER['REQUEST_URI']); + exit; + } + else + { + foreach (array_keys($aRegisteredLangs) as $sLang) + { + $aRegisteredLanguageNames[$sLang] = $aLanguageNames[$sLang]; + } } $sLanguageSelect = $default->defaultLanguage;