#12: Corrected the way redirects work on the gallery side due to an issue when trying out on a real system

This commit is contained in:
Andy Heathershaw 2017-09-04 21:41:08 +01:00
parent f901ffa855
commit d0d96df17d
1 changed files with 3 additions and 2 deletions

View File

@ -22,8 +22,9 @@ class AlbumController extends Controller
$album = DbHelper::getAlbumByPath($albumUrlAlias);
if (is_null($album))
{
// Check redirects
$redirect = AlbumRedirect::where(DB::raw('\'/a\' + source_url'), $request->path())->first();
// Check redirects (remove the first 'a' at the beginning - e.g. "a/Florida-2015" => "/Florida-2015"
$requestPath = preg_replace('/^a/', '', $request->path());
$redirect = AlbumRedirect::where('source_url', $requestPath)->first();
if (is_null($redirect))
{