Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update utilities.inc #104

Open
wants to merge 1 commit into
base: 7.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion includes/utilities.inc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,15 @@ function islandora_openseadragon_construct_clip_url($params, $download = FALSE)
$path = parse_url($rft_id, PHP_URL_PATH);
// Replace the first left-most slash to get a more Drupal-y path to validate
// against.
$drupal_path = preg_replace('/\//', '', $path, 1);
//Commented out June 30, 2021
//$drupal_path = preg_replace('/\//', '', $path, 1);
//code immediately below replaces code on line 74
//fixes issue described here:
//https://github.com/Islandora/islandora_openseadragon/pull/67/files/e0b6712c87022edb7efe573bf521e4c0573cf91c#diff-28dc8af6e01241f4cc9d09f1c86eeec15dbd094d32e260b4f099ef8d9e9b46d0
if (base_path() !== '/') {
$path = substr($path, strlen(base_path()) - 1);
}

$item = menu_get_item($drupal_path);
if (!$item || $item['path'] !== 'islandora/object/%/datastream/%/view') {
return FALSE;
Expand Down