Commit 78bbfbaaa0135883546e848a32329ef33659b5bd
1 parent
173bc363
Fixed error with dmsDefaults setting fileSystemRoot too late for dynamic db conf…
…ig read. Then removed attempts to fix broken path on windows Committed by: Paul Barrett
Showing
2 changed files
with
5 additions
and
25 deletions
config/dmsDefaults.php
| ... | ... | @@ -483,6 +483,9 @@ class KTInit { |
| 483 | 483 | function initConfig() { |
| 484 | 484 | global $default; |
| 485 | 485 | $oKTConfig = KTConfig::getSingleton(); |
| 486 | + | |
| 487 | + // Override the config setting - KT_DIR is resolved on page load | |
| 488 | + $oKTConfig->setdefaultns('KnowledgeTree', 'fileSystemRoot', KT_DIR); | |
| 486 | 489 | |
| 487 | 490 | // TODO: refactor when all the config settings are stored in the database |
| 488 | 491 | // Check for the config cache | ... | ... |
plugins/thumbnails/thumbnails.php
| ... | ... | @@ -158,15 +158,8 @@ class thumbnailGenerator extends BaseProcessor |
| 158 | 158 | $thumbnaildir = $default->internalVarDirectory.DIRECTORY_SEPARATOR.'thumbnails'; |
| 159 | 159 | |
| 160 | 160 | if (stristr(PHP_OS,'WIN')) { |
| 161 | - $thumbnaildir = str_replace('/', '\\', $thumbnaildir); | |
| 162 | - $pdfFile = str_replace('/', '\\', $pdfFile); | |
| 163 | - } | |
| 164 | - | |
| 165 | - if (!preg_match('/' . str_replace('/', '\/', str_replace('\\', '\\\\', KT_DIR)) . '/', $thumbnaildir)) | |
| 166 | - { | |
| 167 | - if (stristr(PHP_OS,'WIN')) { | |
| 168 | - $thumbnaildir = KT_DIR . '\\' . trim($thumbnaildir, '\\'); | |
| 169 | - } | |
| 161 | + $thumbnaildir = str_replace('/', '\\', $thumbnaildir); | |
| 162 | + $pdfFile = str_replace('/', '\\', $pdfFile); | |
| 170 | 163 | } |
| 171 | 164 | |
| 172 | 165 | $thumbnailfile = $thumbnaildir.DIRECTORY_SEPARATOR.$this->document->iId.'.jpg'; |
| ... | ... | @@ -237,13 +230,6 @@ class ThumbnailViewlet extends KTDocumentViewlet { |
| 237 | 230 | $varDir = str_replace('/', '\\', $varDir); |
| 238 | 231 | } |
| 239 | 232 | |
| 240 | - if (!preg_match('/' . str_replace('/', '\/', str_replace('\\', '\\\\', KT_DIR)) . '/', $thumbnaildir)) | |
| 241 | - { | |
| 242 | - if (stristr(PHP_OS,'WIN')) { | |
| 243 | - $varDir = KT_DIR . '\\' . trim($varDir, '\\'); | |
| 244 | - } | |
| 245 | - } | |
| 246 | - | |
| 247 | 233 | $thumbnailCheck = $varDir . '/thumbnails/'.$documentId.'.jpg'; |
| 248 | 234 | |
| 249 | 235 | // if the thumbnail doesn't exist try to create it |
| ... | ... | @@ -279,15 +265,6 @@ class ThumbnailViewlet extends KTDocumentViewlet { |
| 279 | 265 | public function get_width($documentId){ |
| 280 | 266 | global $default; |
| 281 | 267 | $varDir = $default->internalVarDirectory; |
| 282 | - if (stristr(PHP_OS,'WIN')) | |
| 283 | - { | |
| 284 | - $varDir = str_replace('/', '\\', $varDir); | |
| 285 | - | |
| 286 | - if (!preg_match('/' . str_replace('/', '\/', str_replace('\\', '\\\\', KT_DIR)) . '/', $thumbnaildir)) | |
| 287 | - { | |
| 288 | - $varDir = KT_DIR . '\\' . trim($varDir, '\\'); | |
| 289 | - } | |
| 290 | - } | |
| 291 | 268 | $thumbnailfile = $varDir . '/thumbnails/'.$documentId.'.jpg'; |
| 292 | 269 | $size = getimagesize($thumbnailfile); |
| 293 | 270 | return $size[0]; | ... | ... |