Skip to content

Commit

Permalink
Fix for OSD paged viewer isn't showing up on french pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
ruebot committed Feb 15, 2024
1 parent 629226c commit 0949b1b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/IIIFManifestParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,20 @@ public function getTileSources($manifest_url, $access_token = NULL) {
// If the URL is relative, make it absolute.
if (substr($manifest_url, 0, 4) !== "http") {
$manifest_url = ltrim($manifest_url, '/');
$manifest_url = Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString() . $manifest_url;

// Check if the URL starts with "/fr/" and adjust accordingly.
// https://redmine.library.yorku.ca/issues/3957
if (strpos($manifest_url, '/fr/') === 0) {
// If the URL starts with "/fr/", don't trim the first slash.
$append_slash = '';
}
else {
// If the URL doesn't start with "/fr/", trim the first slash.
$append_slash = '/';
}

// Construct the absolute URL.
$manifest_url = Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString() . $append_slash . $manifest_url;
}

try {
Expand Down

0 comments on commit 0949b1b

Please sign in to comment.