Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slattery/2af576d68141d57021b98d78685b8ac6 to your computer and use it in GitHub Desktop.
Save slattery/2af576d68141d57021b98d78685b8ac6 to your computer and use it in GitHub Desktop.
bibcite-ris-encoder-nondigitfix-20231103-01.patch
diff --git a/modules/bibcite_ris/src/Encoder/RISEncoder.php b/modules/bibcite_ris/src/Encoder/RISEncoder.php
index 78cc087..f5af92d 100644
--- a/modules/bibcite_ris/src/Encoder/RISEncoder.php
+++ b/modules/bibcite_ris/src/Encoder/RISEncoder.php
@@ -60,7 +60,7 @@ class RISEncoder implements EncoderInterface, DecoderInterface {
$record['EP'] = (array) $record['EP'];
}
$max_sp = array_key_exists('SP', $record) ? max($record['SP']) : NULL;
- $max_ep = array_key_exists('EP', $record) ? max($record['EP']) : 0;
+ $max_ep = array_key_exists('EP', $record) && is_int($record['EP']) ? max($record['EP']) : 0;
if ($max_sp && $max_sp > $max_ep) {
$pages_string .= $max_sp . '+';
array_splice($record['SP'], array_search($max_sp, $record['SP']), 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment