diff --git a/lib/Museum.php b/lib/Museum.php index 59f2d9fd..2d619234 100644 --- a/lib/Museum.php +++ b/lib/Museum.php @@ -44,13 +44,15 @@ class Museum extends PropertiesBase{ && isset($parsedUrl['fragment']) ){ - $id = preg_replace('/,.+$/ius', '', $parsedUrl['fragment']); + $id = (string)$parsedUrl['fragment']; + $id = preg_replace('/,.+$/ius', '', $id); $id = preg_replace('|^/|ius', '', $id); $outputUrl = 'https://' . $parsedUrl['host'] . '/en/collection/' . $id; } if(preg_match('|^en/rijksstudio/[^/]+/[^/]+/objects$|ius', $parsedUrl['path']) && isset($parsedUrl['fragment'])){ - $id = preg_replace('/,.+$/ius', '', $parsedUrl['fragment']); + $id = (string)$parsedUrl['fragment']; + $id = preg_replace('/,.+$/ius', '', $id); $id = preg_replace('|^/|ius', '', $id); $outputUrl = 'https://' . $parsedUrl['host'] . '/en/collection/' . $id; }