Skip to content

Commit

Permalink
Remove outdated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
GlazerMann authored Dec 11, 2024
1 parent 6420e90 commit daff561
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions apiFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ function adsabs_api(array $ids, array &$templates, string $identifier): void {
}

/** @param array<string> $_ids
@param array<Template> $templates */
@param array<Template> $templates */
function query_doi_api(array $_ids, array &$templates): void { // $id not used yet // Pointer to save memory
foreach ($templates as $template) {
expand_by_doi($template);
Expand All @@ -494,10 +494,6 @@ function query_doi_api(array $_ids, array &$templates): void { // $id not used y

function expand_by_doi(Template $template, bool $force = false): void {
set_time_limit(120);
// Because it can recover rarely used parameters such as editors, series & isbn,
// there will be few instances where it could not in principle be profitable to
// run this function, so we don't check this first.

if (!$template->verify_doi()) {
return; // TODO - sometimes CrossRef has Data even when DOI is broken, perhaps skip this
}
Expand All @@ -509,6 +505,9 @@ function expand_by_doi(Template $template, bool $force = false): void {
if (preg_match(REGEXP_DOI_ISSN_ONLY, $doi)) {
return;
}
if (in_array($doi, BAD_DOI_ARRAY)) { // Really bad ones that do not really exist at all
return;
}
if ($doi && preg_match('~^10\.2307/(\d+)$~', $doi)) {
$template->add_if_new('jstor', substr($doi, 8));
}
Expand Down

0 comments on commit daff561

Please sign in to comment.