Skip to content

Commit

Permalink
Merge branch 'pkp:main' into f5000_7431
Browse files Browse the repository at this point in the history
  • Loading branch information
jyhein authored Mar 21, 2024
2 parents 3fbc316 + a2324e5 commit 2685044
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions classes/template/PKPTemplateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
use APP\core\Application;
use APP\core\PageRouter;
use APP\core\Request;

require_once('./lib/pkp/lib/vendor/smarty/smarty/libs/plugins/modifier.escape.php'); // Seems to be needed?
use APP\core\Services;
use APP\facades\Repo;
use APP\file\PublicFileManager;
Expand Down Expand Up @@ -66,6 +63,8 @@
use Smarty;
use Smarty_Internal_Template;

require_once('./lib/pkp/lib/vendor/smarty/smarty/libs/plugins/modifier.escape.php'); // Seems to be needed?
/* This definition is required by Smarty */
define('SMARTY_DIR', Core::getBaseDir() . '/lib/pkp/lib/vendor/smarty/smarty/libs/');

Expand Down Expand Up @@ -505,10 +504,10 @@ public function cacheLess($path, $styles)
*/
public function getCachedLessFilePath($name)
{
$cacheDirectory = CacheManager::getFileCachePath();
$context = $this->_request->getContext();
$contextId = $context instanceof Context ? $context->getId() : 0;
return "{$cacheDirectory}/{$contextId}-{$name}.css";
$directory = CacheManager::getFileCachePath();
$contextId = $this->_request->getContext()?->getId() ?? 0;
$hash = crc32($this->_request->getBaseUrl());
return "{$directory}/{$contextId}-{$name}-{$hash}.css";
}

/**
Expand Down

0 comments on commit 2685044

Please sign in to comment.