Skip to content

Commit

Permalink
Merge pull request #261 from GlazerMann/patch-8
Browse files Browse the repository at this point in the history
Forget dx.doi.org URLS when getting DOIs from them
  • Loading branch information
Martin R. Smith committed Oct 30, 2017
2 parents e4e4ed7 + 72bd364 commit 06782d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,9 @@ protected function get_identifiers_from_url($url_sent = NULL) {
} elseif (preg_match("~^https?://d?x?\.?doi\.org/([^\?]*)~", $url, $match)) {
quiet_echo("\n ~ URL is hard-coded DOI; converting to use DOI parameter.");
if (strpos($this->name, 'web')) $this->name = 'Cite journal';
if (is_null($url_sent)) {
$this->forget('url');
}
return $this->add_if_new("doi", urldecode($match[1])); // Will expand from DOI when added

} elseif (extract_doi($url)[1]) {
Expand Down

0 comments on commit 06782d2

Please sign in to comment.