diff --git a/config/dmsDefaults.php b/config/dmsDefaults.php index e55fd56..81fdf00 100644 --- a/config/dmsDefaults.php +++ b/config/dmsDefaults.php @@ -483,6 +483,9 @@ class KTInit { function initConfig() { global $default; $oKTConfig = KTConfig::getSingleton(); + + // Override the config setting - KT_DIR is resolved on page load + $oKTConfig->setdefaultns('KnowledgeTree', 'fileSystemRoot', KT_DIR); // TODO: refactor when all the config settings are stored in the database // Check for the config cache diff --git a/plugins/thumbnails/thumbnails.php b/plugins/thumbnails/thumbnails.php index b32f1c8..37548de 100755 --- a/plugins/thumbnails/thumbnails.php +++ b/plugins/thumbnails/thumbnails.php @@ -158,15 +158,8 @@ class thumbnailGenerator extends BaseProcessor $thumbnaildir = $default->internalVarDirectory.DIRECTORY_SEPARATOR.'thumbnails'; if (stristr(PHP_OS,'WIN')) { - $thumbnaildir = str_replace('/', '\\', $thumbnaildir); - $pdfFile = str_replace('/', '\\', $pdfFile); - } - - if (!preg_match('/' . str_replace('/', '\/', str_replace('\\', '\\\\', KT_DIR)) . '/', $thumbnaildir)) - { - if (stristr(PHP_OS,'WIN')) { - $thumbnaildir = KT_DIR . '\\' . trim($thumbnaildir, '\\'); - } + $thumbnaildir = str_replace('/', '\\', $thumbnaildir); + $pdfFile = str_replace('/', '\\', $pdfFile); } $thumbnailfile = $thumbnaildir.DIRECTORY_SEPARATOR.$this->document->iId.'.jpg'; @@ -237,13 +230,6 @@ class ThumbnailViewlet extends KTDocumentViewlet { $varDir = str_replace('/', '\\', $varDir); } - if (!preg_match('/' . str_replace('/', '\/', str_replace('\\', '\\\\', KT_DIR)) . '/', $thumbnaildir)) - { - if (stristr(PHP_OS,'WIN')) { - $varDir = KT_DIR . '\\' . trim($varDir, '\\'); - } - } - $thumbnailCheck = $varDir . '/thumbnails/'.$documentId.'.jpg'; // if the thumbnail doesn't exist try to create it @@ -279,15 +265,6 @@ class ThumbnailViewlet extends KTDocumentViewlet { public function get_width($documentId){ global $default; $varDir = $default->internalVarDirectory; - if (stristr(PHP_OS,'WIN')) - { - $varDir = str_replace('/', '\\', $varDir); - - if (!preg_match('/' . str_replace('/', '\/', str_replace('\\', '\\\\', KT_DIR)) . '/', $thumbnaildir)) - { - $varDir = KT_DIR . '\\' . trim($varDir, '\\'); - } - } $thumbnailfile = $varDir . '/thumbnails/'.$documentId.'.jpg'; $size = getimagesize($thumbnailfile); return $size[0];