Skip to content

Commit

Permalink
pkp/pkp-lib#10786 fix resolver plugin page range matching
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitlinnewson committed Jan 8, 2025
1 parent 57f387c commit 2d08417
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plugins/gateways/resolver/ResolverPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ function fetch($args, $request) {
foreach ($submissionsIterator as $submission) {
// Look for the correct page in the list of articles.
$matches = null;
if (PKPString::regexp_match_get('/^[Pp][Pp]?[.]?[ ]?(\d+)$/', $submission->getPages(), $matches)) {
if (PKPString::regexp_match_get('/^[Pp]?[Pp]?[.]?[ ]?(\d+)$/', $submission->getPages(), $matches)) {
$matchedPage = $matches[1];
if ($page == $matchedPage) $request->redirect(null, 'article', 'view', $submission->getBestId());
}
if (PKPString::regexp_match_get('/^[Pp][Pp]?[.]?[ ]?(\d+)[ ]?-[ ]?([Pp][Pp]?[.]?[ ]?)?(\d+)$/', $submission->getPages(), $matches)) {
if (PKPString::regexp_match_get('/^[Pp]?[Pp]?[.]?[ ]?(\d+)[ ]?-[ ]?([Pp][Pp]?[.]?[ ]?)?(\d+)$/', $submission->getPages(), $matches)) {
$matchedPageFrom = $matches[1];
$matchedPageTo = $matches[3];
if ($page >= $matchedPageFrom && ($page < $matchedPageTo || ($page == $matchedPageTo && $matchedPageFrom = $matchedPageTo))) $request->redirect(null, 'article', 'view', $submission->getBestId());
Expand Down Expand Up @@ -173,5 +173,3 @@ function exportHoldings() {
}
}
}


0 comments on commit 2d08417

Please sign in to comment.