Skip to content

Commit

Permalink
Merge pull request #568 from ChristianGiupponi/3.0
Browse files Browse the repository at this point in the history
Check page slug and locale
  • Loading branch information
nWidart authored Jul 31, 2018
2 parents 6d1bdc2 + 785f1b2 commit adbca71
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Modules/Page/Http/Controllers/PublicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public function uri($slug)

$this->throw404IfNotFound($page);

$currentTranslatedPage = $page->getTranslation(locale());
if ($slug !== $currentTranslatedPage->slug) {

return redirect()->to($currentTranslatedPage->locale . '/' . $currentTranslatedPage->slug, 301);
}

$template = $this->getTemplateForPage($page);

return view($template, compact('page'));
Expand Down

0 comments on commit adbca71

Please sign in to comment.