Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #6530 #6556

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix #6530
libkoi committed May 30, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 9bb4f110543b692681a1aaed456d44887720c814
Original file line number Diff line number Diff line change
@@ -316,6 +316,12 @@ private void addDoi(Map<Field, String> hm, String val) {
if (doi.startsWith("doi:")) {
doi = doi.replaceAll("(?i)doi:", "").trim();
hm.put(StandardField.DOI, doi);
} else {
String doiRegEx = "10\\.[0-9]{4,}(?:\\.[0-9]+)*/(?:(?![\"&'])\\S)+";
Pattern pattern = Pattern.compile(doiRegEx);
if (pattern.matcher(doi).matches()) {
hm.put(StandardField.DOI, doi);
}
}
}
}