3 namespace BookStack\Theming;
5 use BookStack\Facades\Theme;
6 use BookStack\Http\Controller;
7 use BookStack\Util\FilePathNormalizer;
9 class ThemeController extends Controller
12 * Serve a public file from the configured theme.
14 public function publicFile(string $theme, string $path)
16 $cleanPath = FilePathNormalizer::normalize($path);
17 if ($theme !== Theme::getTheme() || !$cleanPath) {
21 $filePath = theme_path("public/{$cleanPath}");
22 if (!file_exists($filePath)) {
26 $response = $this->download()->streamedFileInline($filePath);
27 $response->setMaxAge(86400);