Skip to content

Commit

Permalink
do not drop bad urls, if they are archived
Browse files Browse the repository at this point in the history
  • Loading branch information
GlazerMann authored Oct 2, 2023
1 parent 97b4161 commit 578dde4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Zotero.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public static function drop_urls_that_match_dois(array &$templates) : void { //
} elseif (str_ireplace(PROXY_HOSTS_TO_ALWAYS_DROP,'', $url) !== $url && $template->get('doi-access') === 'free') {
report_forget("Existing proxy URL resulting from equivalent free DOI; dropping URL");
$template->forget($url_kind);
} elseif (str_ireplace(PROXY_HOSTS_TO_ALWAYS_DROP,'', $url) !== $url) {
} elseif (str_ireplace(PROXY_HOSTS_TO_ALWAYS_DROP,'', $url) !== $url && $template->blank(['archive-url', 'archiveurl'])) {
report_forget("Existing proxy URL resulting from equivalent DOI; fixing URL");
$template->set($url_kind, "https://dx.doi.org/" . doi_encode($doi));
} elseif (preg_match('~www.sciencedirect.com/science/article/B[^/\-]*\-[^/\-]+\-[^/\-]+/~', $url)) {
Expand Down

0 comments on commit 578dde4

Please sign in to comment.