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

Done: more jstor proxy removal #1368

Merged
merged 1 commit into from
Feb 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -856,20 +856,27 @@ public function get_identifiers_from_url($url_sent = NULL) {
$this->set($url_type, $url); // Save it
}
}

// https://www.jstor.org.stuff/proxy/stuff/stable/3347357 and such
if (preg_match('~^(https?://(?:www\.|)jstor\.org)(?:\S*proxy\S*/|/)(?:stable|discover)/10.2307/(.+)$~i', $url, $matches)) {
$url = $matches[1] . '/stable/' . $matches[2] ; // that is default. This also means we get jstor not doi
if (!is_null($url_sent)) {
$this->set($url_type, $url); // Update URL with cleaner one. Will probably call forget on it below
}
}

// https://www.jstor.org.libweb.lib.utsa.edu/stable/3347357 and such
if (preg_match('~^https?://(?:www\.|)jstor\.org\.[^/]+/(?:stable|discover)/(.+)$~i', $url, $matches)) {
$url = 'https://www.jstor.org/stable/' . $matches[1] ;
if (!is_null($url_sent)) {
$this->set($url_type, $url); // Update URL with cleaner one
}
}
// https://www-jstor-org.libezp.lib.lsu.edu/stable/10.7249/j.ctt4cgd90.10 and such
if (preg_match('~^https?://(?:www-|)jstor-org[-\.]\S+/(?:stable|discover)/(.+)$~i', $url, $matches)) {
$url = 'https://www.jstor.org/stable/' . $matches[1] ;
if (!is_null($url_sent)) {
$this->set($url_type, $url); // Update URL with cleaner one
}
}
}

if (preg_match("~^https?://(?:d?x?\.?doi\.org|doi\.library\.ubc\.ca)/([^\?]*)~i", $url, $match)) {
quietly('report_modification', "URL is hard-coded DOI; converting to use DOI parameter.");
Expand Down