From b41ad31567e0ce4aafe793d7de25288bbde01749 Mon Sep 17 00:00:00 2001 From: Jorran de Wit <jorrandewit@outlook.com> Date: Sat, 31 Mar 2018 11:13:24 +0200 Subject: [PATCH] Restrict url regexes to avoid unexpected false matching --- journals/constants.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/journals/constants.py b/journals/constants.py index 08a507e28..c98733fee 100644 --- a/journals/constants.py +++ b/journals/constants.py @@ -30,7 +30,11 @@ REGEX_CHOICES = '|'.join([ SCIPOST_JOURNAL_PHYSICS ]) -PUBLICATION_DOI_REGEX = PUBLICATION_DOI_VALIDATION_REGEX = '[a-zA-Z]+.[0-9]+(.[0-9]+.[0-9]{3,})?' +# Regex used for URLs of specific Publications and for +# doi validation during the publication process. +PUBLICATION_DOI_REGEX = '({})'.format(REGEX_CHOICES) +PUBLICATION_DOI_REGEX += '.[0-9]+(.[0-9]+.[0-9]{3,})?' +PUBLICATION_DOI_VALIDATION_REGEX = PUBLICATION_DOI_REGEX SCIPOST_JOURNALS_DOMAINS = ( ('E', 'Experimental'), -- GitLab