Skip to content

Commit

Permalink
pkp/pkp-lib#10786 fix page matching regex
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitlinnewson authored and asmecher committed Jan 9, 2025
1 parent ecbf19d commit e454458
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions JatsTemplatePlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ function toXml(&$record, $format = null) {
$matchedPage = htmlspecialchars($matches[1]);
$response .= "\t\t\t\t<fpage>$matchedPage</fpage><lpage>$matchedPage</lpage>\n";
$pageCount = 1;
} elseif (PKPString::regexp_match_get('/^[Pp][Pp]?[.]?[ ]?(\d+)$/', $article->getPages(), $matches)) {
} elseif (PKPString::regexp_match_get('/^[Pp]?[Pp]?[.]?[ ]?(\d+)$/', $article->getPages(), $matches)) {
$matchedPage = htmlspecialchars($matches[1]);
$response .= "\t\t\t\t<fpage>$matchedPage</fpage><lpage>$matchedPage</lpage>\n";
$pageCount = 1;
} elseif (PKPString::regexp_match_get('/^[Pp][Pp]?[.]?[ ]?(\d+)[ ]?-[ ]?([Pp][Pp]?[.]?[ ]?)?(\d+)$/', $article->getPages(), $matches)) {
} elseif (PKPString::regexp_match_get('/^[Pp]?[Pp]?[.]?[ ]?(\d+)[ ]?-[ ]?([Pp][Pp]?[.]?[ ]?)?(\d+)$/', $article->getPages(), $matches)) {
$matchedPageFrom = htmlspecialchars($matches[1]);
$matchedPageTo = htmlspecialchars($matches[3]);
$response .=
Expand Down

0 comments on commit e454458

Please sign in to comment.