]> BookStack Code Mirror - bookstack/blobdiff - app/helpers.php
Fixed occurances of altered titles in search results
[bookstack] / app / helpers.php
index 618c71bee1927a00563b44401e5114695a1549d9..9edc22c403d9b1a7859baaec7983a8ad14e898a4 100644 (file)
@@ -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));