]>
BookStack Code Mirror - bookstack/commitdiff
projects
/
bookstack
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
a58102d
)
Refactor SettingController to validate categies by existing view files
author
Lachlan Tripolone
<redacted>
Thu, 10 Oct 2024 23:40:38 +0000
(10:40 +1100)
committer
Lachlan Tripolone
<redacted>
Thu, 10 Oct 2024 23:40:38 +0000
(10:40 +1100)
app/Settings/SettingController.php
patch
|
blob
|
history
diff --git
a/app/Settings/SettingController.php
b/app/Settings/SettingController.php
index bdbc3c78a392dce4bc97b7ae419f586147205b66..6ecc2bd1de177a54c41a3a7b1d31773f851b0d7a 100644
(file)
--- a/
app/Settings/SettingController.php
+++ b/
app/Settings/SettingController.php
@@
-9,8
+9,6
@@
use Illuminate\Http\Request;
class SettingController extends Controller
{
- protected array $settingCategories = ['features', 'customization', 'registration'];
-
/**
* Handle requests to the settings index path.
*/
@@
-59,8
+57,8
@@
class SettingController extends Controller
protected function ensureCategoryExists(string $category): void
{
- if (!
in_array($category, $this->settingCategories
)) {
- abort(404);
+ if (!
view()->exists('settings.' . $category
)) {
+ abort(404
, 'Category not found'
);
}
}
}