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()
315315 }
316316
317317 //View any of the pages: contact, terms, privacy
318- public function pages (request $ request )
318+ public function pages (Request $ request )
319319 {
320320 $ 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+
322333 try {
323334 $ data ['page ' ] = Page::select ($ name )->first ();
324335 } catch (Exception $ e ) {
325336 return abort (404 );
326337 }
327-
338+
328339 return view ('pages ' , ['data ' => $ data , 'name ' => $ name ]);
329340 }
330341
You can’t perform that action at this time.
0 commit comments