File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -315,16 +315,27 @@ public function delFavicon()
315
315
}
316
316
317
317
//View any of the pages: contact, terms, privacy
318
- public function pages (request $ request )
318
+ public function pages (Request $ request )
319
319
{
320
320
$ name = $ request ->name ;
321
-
321
+
322
+ $ enabledPages = [
323
+ 'contact ' => env ('DISPLAY_FOOTER_CONTACT ' , false ),
324
+ 'terms ' => env ('DISPLAY_FOOTER_TERMS ' , false ),
325
+ 'privacy ' => env ('DISPLAY_FOOTER_PRIVACY ' , false ),
326
+ // Add other pages here as needed
327
+ ];
328
+
329
+ if (!array_key_exists ($ name , $ enabledPages ) || !$ enabledPages [$ name ]) {
330
+ return abort (404 );
331
+ }
332
+
322
333
try {
323
334
$ data ['page ' ] = Page::select ($ name )->first ();
324
335
} catch (Exception $ e ) {
325
336
return abort (404 );
326
337
}
327
-
338
+
328
339
return view ('pages ' , ['data ' => $ data , 'name ' => $ name ]);
329
340
}
330
341
You can’t perform that action at this time.
0 commit comments