#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

View File

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