mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Merge branch 'v21.05.x'
This commit is contained in:
@ -49,7 +49,7 @@ class ThemeService
|
||||
public function readThemeActions()
|
||||
{
|
||||
$themeActionsFile = theme_path('functions.php');
|
||||
if (file_exists($themeActionsFile)) {
|
||||
if ($themeActionsFile && file_exists($themeActionsFile)) {
|
||||
require $themeActionsFile;
|
||||
}
|
||||
}
|
||||
|
@ -24,9 +24,9 @@ class FileLoader extends BaseLoader
|
||||
}
|
||||
|
||||
if (is_null($namespace) || $namespace === '*') {
|
||||
$themeTranslations = $this->loadPath(theme_path('lang'), $locale, $group);
|
||||
$originalTranslations = $this->loadPath($this->path, $locale, $group);
|
||||
|
||||
$themePath = theme_path('lang');
|
||||
$themeTranslations = $themePath ? $this->loadPath($themePath, $locale, $group) : [];
|
||||
$originalTranslations = $this->loadPath($this->path, $locale, $group);
|
||||
return array_merge($originalTranslations, $themeTranslations);
|
||||
}
|
||||
|
||||
|
@ -99,13 +99,15 @@ function setting(string $key = null, $default = null)
|
||||
|
||||
/**
|
||||
* Get a path to a theme resource.
|
||||
* Returns null if a theme is not configured and
|
||||
* therefore a full path is not available for use.
|
||||
*/
|
||||
function theme_path(string $path = ''): string
|
||||
function theme_path(string $path = ''): ?string
|
||||
{
|
||||
$theme = config('view.theme');
|
||||
|
||||
if (!$theme) {
|
||||
return '';
|
||||
return null;
|
||||
}
|
||||
|
||||
return base_path('themes/' . $theme . ($path ? DIRECTORY_SEPARATOR . $path : $path));
|
||||
|
Reference in New Issue
Block a user