Skip to content

Commit

Permalink
pkp/pkp-lib#7595 allow valid special characters in journal acronym us…
Browse files Browse the repository at this point in the history
…ed in DOI suffix
  • Loading branch information
bozana authored and asmecher committed Sep 2, 2022
1 parent d317b84 commit a26111a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions classes/plugins/PubIdPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function getPubId($pubObject) {
$pubIdSuffix = $this->getSetting($contextId, $suffixPatternsFieldNames[$pubObjectType]);

// %j - journal initials, remove special characters and uncapitalize
$pubIdSuffix = PKPString::regexp_replace('/%j/', PKPString::regexp_replace('/[^A-Za-z0-9]/', '', PKPString::strtolower($context->getAcronym($context->getPrimaryLocale()))), $pubIdSuffix);
$pubIdSuffix = PKPString::regexp_replace('/%j/', PKPString::regexp_replace('/[^-._;()\/A-Za-z0-9]/', '', PKPString::strtolower($context->getAcronym($context->getPrimaryLocale()))), $pubIdSuffix);

// %x - custom identifier
if ($pubObject->getStoredPubId('publisher-id')) {
Expand Down Expand Up @@ -219,7 +219,7 @@ function getPubId($pubObject) {
break;

default:
$pubIdSuffix = PKPString::regexp_replace('/[^A-Za-z0-9]/', '', PKPString::strtolower($context->getAcronym($context->getPrimaryLocale())));
$pubIdSuffix = PKPString::regexp_replace('/[^-._;()\/A-Za-z0-9]/', '', PKPString::strtolower($context->getAcronym($context->getPrimaryLocale())));

if ($issue) {
$pubIdSuffix .= '.v' . $issue->getVolume() . 'i' . $issue->getNumber();
Expand Down
2 changes: 1 addition & 1 deletion plugins/pubIds/doi/DOIPubIdPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ public function addPublicationFormFields($hookName, $form) {
'value' => $form->publication->getData('pub-id::doi'),
'prefix' => $prefix,
'pattern' => $pattern,
'contextInitials' => PKPString::regexp_replace('/[^A-Za-z0-9]/', '', PKPString::strtolower($form->submissionContext->getData('acronym', $form->submissionContext->getData('primaryLocale')))) ?? '',
'contextInitials' => PKPString::regexp_replace('/[^-._;()\/A-Za-z0-9]/', '', PKPString::strtolower($form->submissionContext->getData('acronym', $form->submissionContext->getData('primaryLocale')))) ?? '',
'separator' => '/',
'submissionId' => $form->publication->getData('submissionId'),
'assignIdLabel' => __('plugins.pubIds.doi.editor.doi.assignDoi'),
Expand Down

0 comments on commit a26111a

Please sign in to comment.