Modify maintenance.php to improve references checking as in spoolnews/rslight-lib.

This commit is contained in:
Retro_Guy 2024-01-03 14:57:27 -07:00
parent 18e7e5eb66
commit 3fd191eed8
1 changed files with 5 additions and 5 deletions

View File

@ -259,10 +259,12 @@ function import_articles($group)
} }
if ($is_header == 1) { if ($is_header == 1) {
$response = str_replace("\t", " ", $response); $response = str_replace("\t", " ", $response);
if (strpos($response, ': ') !== false) {
$ref = 0;
}
// Find article date // Find article date
if (stripos($response, "Date: ") === 0) { if (stripos($response, "Date: ") === 0) {
$finddate = explode(': ', $response, 2); $finddate = explode(': ', $response, 2);
$ref = 0;
} }
// Get overview data // Get overview data
$mid[1] = $row['msgid']; $mid[1] = $row['msgid'];
@ -278,10 +280,8 @@ function import_articles($group)
$references = $this_references[1]; $references = $this_references[1];
$ref = 1; $ref = 1;
} }
if ((stripos($response, ':') === false) && (strpos($response, '>'))) { if (preg_match('/^\s/', $response) && $ref == 1) {
if ($ref == 1) { $references = $references . $response;
$references = $references . $response;
}
} }
$response = str_replace("\n", "", str_replace("\r", "", $response)); $response = str_replace("\n", "", str_replace("\r", "", $response));
} else { } else {