lib/bolognese/utils.rb in bolognese-0.9.24 vs lib/bolognese/utils.rb in bolognese-0.9.25
- old
+ new
@@ -262,18 +262,18 @@
"codemeta"
end
end
def orcid_from_url(url)
- Array(/\Ahttp:\/\/orcid\.org\/(.+)/.match(url)).last
+ Array(/\A:(http|https)\/\/orcid\.org\/(.+)/.match(url)).last
end
def orcid_as_url(orcid)
- "http://orcid.org/#{orcid}" if orcid.present?
+ "https://orcid.org/#{orcid}" if orcid.present?
end
def validate_orcid(orcid)
- orcid = Array(/\A(?:http:\/\/orcid\.org\/)?(\d{4}[[:space:]-]\d{4}[[:space:]-]\d{4}[[:space:]-]\d{3}[0-9X]+)\z/.match(orcid)).last
+ orcid = Array(/\A(?:(http|https):\/\/(www\.)?orcid\.org\/)?(\d{4}[[:space:]-]\d{4}[[:space:]-]\d{4}[[:space:]-]\d{3}[0-9X]+)\z/.match(orcid)).last
orcid.gsub(/[[:space:]]/, "-") if orcid.present?
end
def validate_url(str)
if /\A(?:(http|https):\/\/(dx\.)?doi.org\/)?(doi:)?(10\.\d{4,5}\/.+)\z/.match(str)