From 655ced04a9d765379cd7e2743bf95f549530a5d4 Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Wed, 11 Dec 2024 09:02:25 -0600 Subject: [PATCH 1/4] Deal with 10.4324/9781315875798-18 --- expandFns.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/expandFns.php b/expandFns.php index f8c93002ce..09fb3f3add 100644 --- a/expandFns.php +++ b/expandFns.php @@ -292,7 +292,17 @@ function interpret_doi_header(array $headers_test, string $doi): ?bool { return true; } bot_debug_log('Got weird stuff for HDL: ' . echoable_doi($doi)); - return null; // @codeCoverageIgnoreEnd + return null; + } + if (strpos($resp0, '302') !== false && strpos($resp1, '503') !== false && $resp2 === '') { + if (isset(NULL_DOI_LIST[$doi])) { + return false; + } + if (isset(NULL_DOI_BUT_GOOD[$doi])) { + return true; + } + bot_debug_log('Got two bad hops for HDL: ' . echoable_doi($doi)); + return null; } if (stripos($resp0 . $resp1 . $resp2, '404 Not Found') !== false || stripos($resp0 . $resp1 . $resp2, 'HTTP/1.1 404') !== false) { return false; // Bad From 23bb4f8b2dce86d3536bbe6de751a039045459b7 Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Wed, 11 Dec 2024 09:13:29 -0600 Subject: [PATCH 2/4] conflixt --- constants/null_good_doi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/constants/null_good_doi.php b/constants/null_good_doi.php index b6b62d7fc6..e229636f74 100644 --- a/constants/null_good_doi.php +++ b/constants/null_good_doi.php @@ -8,7 +8,7 @@ // We cannot add hdls to this list, since we need the final URL const NULL_DOI_BUT_GOOD = [ '10.17159/2312-3621/2020/v33n3a19' => true, - '10.5479/SI.00810282.639' => true, + '10.5479/SI.00810282.639' => true,dfasdfsdfasd '10.5479/si.00810282.639' => true, '10.1000/100' => true, '10.1001/archfami.9.10.1195' => true, From f9104a718ba6173b567259439264492116547b39 Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Wed, 11 Dec 2024 09:15:32 -0600 Subject: [PATCH 3/4] Update null_good_doi.php --- constants/null_good_doi.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/constants/null_good_doi.php b/constants/null_good_doi.php index c92e6f5a12..d2cf009228 100644 --- a/constants/null_good_doi.php +++ b/constants/null_good_doi.php @@ -7,9 +7,6 @@ // TODO - these need to be manually double checked once in a great while // We cannot add hdls to this list, since we need the final URL const NULL_DOI_BUT_GOOD = [ - '10.17159/2312-3621/2020/v33n3a19' => true, - '10.5479/SI.00810282.639' => true,dfasdfsdfasd - '10.5479/si.00810282.639' => true, '10.1000/100' => true, '10.1001/archfami.9.10.1195' => true, '10.1001/archinte.166.2.241' => true, From ceac9232d14ff6fc6ab86e56f49eabf4cc7f4458 Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Wed, 11 Dec 2024 09:17:17 -0600 Subject: [PATCH 4/4] Update null_good_doi.php --- constants/null_good_doi.php | 1 + 1 file changed, 1 insertion(+) diff --git a/constants/null_good_doi.php b/constants/null_good_doi.php index d2cf009228..075301f1e0 100644 --- a/constants/null_good_doi.php +++ b/constants/null_good_doi.php @@ -7,6 +7,7 @@ // TODO - these need to be manually double checked once in a great while // We cannot add hdls to this list, since we need the final URL const NULL_DOI_BUT_GOOD = [ + dsfadsd '10.1000/100' => true, '10.1001/archfami.9.10.1195' => true, '10.1001/archinte.166.2.241' => true,