Skip to content

Commit

Permalink
Adds check for invalid PIDs to islandora_object_load fails (Islandora…
Browse files Browse the repository at this point in the history
…#689)

* Adds check for invalid PIDs to islandora_object_load fails

* Reordered invalid PID check to catch more invalidity cases

* Exploring the logical limits of Drupal Coding Style

* Removes watchdog logging when islandora_load_object gets a malformed PID
  • Loading branch information
bryjbrown authored and DiegoPino committed Oct 6, 2017
1 parent 100d8dd commit 9b37dcc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion islandora.module
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,12 @@ function islandora_object_load($object_id) {
return $tuque->repository->getObject(urldecode($object_id));
}
catch (Exception $e) {
if ($e->getCode() == '404') {
// Check to see if tuque failure is due to invalid PID.
module_load_include('inc', 'islandora', 'includes/utilities');
if (!islandora_is_valid_pid($object_id)) {
return FALSE;
}
elseif ($e->getCode() == '404') {
return FALSE;
}
else {
Expand Down

0 comments on commit 9b37dcc

Please sign in to comment.