Skip to content

Commit

Permalink
Merge pull request #201 from GlazerMann/patch-7
Browse files Browse the repository at this point in the history
Add support for outdated JSTOR URLS
  • Loading branch information
Martin R. Smith committed Oct 2, 2017
2 parents 70fe831 + a091889 commit d3f719e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,14 @@ protected function get_identifiers_from_url() {
}
// JSTOR
if (strpos($url, "jstor.org") !== FALSE) {
if (strpos($url, "sici")) {
#Skip. We can't do anything more with the SICI, unfortunately.
} elseif (strpos($url, "plants.jstor.org")) {
if (strpos($url, "sici")) { // Outdated
$headers_test = get_headers($url, 1);
if(!empty($headers_test['Location'])) {
$url = $headers_test['Location']; // Redirect
$this->set('url',$url); // Save it
}
}
if (strpos($url, "plants.jstor.org")) {
#Skip. We can't do anything more with the plants, unfortunately.
} elseif (preg_match("~(?|(\d{6,})$|(\d{6,})[^\d%\-])~", $url, $match)) {
if ($this->get('jstor')) {
Expand Down

0 comments on commit d3f719e

Please sign in to comment.