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 authored and asmecher committed Jan 8, 2025
1 parent 6ae6498 commit 2c950c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/gateways/resolver/ResolverPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ public function fetch($args, $request)
foreach ($submissions 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))) {
Expand Down

0 comments on commit 2c950c5

Please sign in to comment.