Skip to content

Commit

Permalink
DC, QDC, DOAJ: Fix handling of OAI IDs that contain colons.
Browse files Browse the repository at this point in the history
  • Loading branch information
EreMaijala committed Mar 6, 2024
1 parent d13b425 commit 9bf524b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/RecordManager/Base/Record/Dc.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function setData($source, $oaiID, $data)
empty($this->doc->recordID)
&& empty($this->doc->children($this->recordNs)->recordID)
) {
$parts = explode(':', $oaiID);
$parts = explode(':', $oaiID, 3);
$id = ('oai' === $parts[0] && !empty($parts[2])) ? $parts[2] : $oaiID;
$this->doc->addChild('recordID', $id);
}
Expand Down
2 changes: 1 addition & 1 deletion src/RecordManager/Base/Record/Doaj.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function setData($source, $oaiID, $data)
empty($this->doc->recordID)
&& empty($this->doc->children($this->recordNs)->recordID)
) {
$parts = explode(':', $oaiID);
$parts = explode(':', $oaiID, 3);
$id = ('oai' === $parts[0] && !empty($parts[2])) ? $parts[2] : $oaiID;
$this->doc->addChild('recordID', $id);
}
Expand Down
2 changes: 1 addition & 1 deletion src/RecordManager/Base/Record/Qdc.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function setData($source, $oaiID, $data)
empty($this->doc->recordID)
&& empty($this->doc->children($this->recordNs)->recordID)
) {
$parts = explode(':', $oaiID);
$parts = explode(':', $oaiID, 3);
$id = ('oai' === $parts[0] && !empty($parts[2])) ? $parts[2] : $oaiID;
$this->doc->addChild('recordID', $id);
}
Expand Down

0 comments on commit 9bf524b

Please sign in to comment.