Commit 3404150a3caede6e04bc8be8eaa1abde546aa3b7

Authored by kevin_fourie
1 parent 89500b45

Merged in from DEV trunk...

KTS-3108
"In bulk import gzip should be removed from the list of supported formats"
Fixed. Removed the text.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen

KTS-3112
"Fatal error on new installation when directed to login.php line 168"
Fixed. This just hides a symptom, but not the reall cause.

Committed By: Conrad Vermeulen
Reviewed By: Megan Watson

KTS-3112
"Fatal error on new installation when directed to login.php line 168"
Fixed. Deleting plugin helper usually fixes this.

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@8210 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/import/zipimportstorage.inc.php
... ... @@ -55,7 +55,7 @@ class KTZipImportStorage extends KTFSImportStorage {
55 55  
56 56 var $aFile = array();
57 57  
58   - var $allowed_extensions = array('tgz', 'tar', 'gz', 'gzip', 'zip', 'deb', 'ar');
  58 + var $allowed_extensions = array('tgz', 'tar', 'gz', 'zip', 'deb', 'ar');
59 59  
60 60 function KTZipImportStorage($sFilesName) {
61 61 $this->aFile = $_FILES[$sFilesName];
... ... @@ -63,7 +63,7 @@ class KTZipImportStorage extends KTFSImportStorage {
63 63  
64 64 // Check the bzip2 lib functions are available
65 65 if(function_exists('bzopen')){
66   - $this->allowed_extensions = array_merge($this->allowed_extensions, array('bz2', 'bzip2', 'tbz'));
  66 + $this->allowed_extensions = array_merge($this->allowed_extensions, array('bz2', 'tbz'));
67 67 }
68 68 }
69 69  
... ... @@ -116,6 +116,13 @@ class KTZipImportStorage extends KTFSImportStorage {
116 116 mkdir($sTmpPath, 0700);
117 117 $this->sBasePath = $sTmpPath;
118 118  
  119 + // Set environment language to output character encoding
  120 + $sOutputEncoding = $oKTConfig->get('export/encoding', 'UTF-8');
  121 + $loc = $sOutputEncoding;
  122 + putenv("LANG=$loc");
  123 + putenv("LANGUAGE=$loc");
  124 + $loc = setlocale(LC_ALL, $loc);
  125 +
119 126 // File Archive doesn't unzip properly so sticking to the original unzip functionality
120 127 if($this->sExtension == 'zip'){
121 128 // ** Original zip functionality
... ...
login.php
... ... @@ -165,8 +165,20 @@ class LoginPageDispatcher extends KTDispatcher {
165 165 $aRegisteredLangs = $oReg->geti18nLanguages('knowledgeTree');
166 166 $aLanguageNames = $oReg->getLanguages('knowledgeTree');
167 167 $aRegisteredLanguageNames = array();
168   - foreach (array_keys($aRegisteredLangs) as $sLang) {
169   - $aRegisteredLanguageNames[$sLang] = $aLanguageNames[$sLang];
  168 +
  169 + if (empty($aRegisteredLangs))
  170 + {
  171 + $query = "DELETE FROM plugin_helper";
  172 + DBUtil::runQuery($query);
  173 + redirect($_SERVER['REQUEST_URI']);
  174 + exit;
  175 + }
  176 + else
  177 + {
  178 + foreach (array_keys($aRegisteredLangs) as $sLang)
  179 + {
  180 + $aRegisteredLanguageNames[$sLang] = $aLanguageNames[$sLang];
  181 + }
170 182 }
171 183 $sLanguageSelect = $default->defaultLanguage;
172 184  
... ...