if (preg_match_all('/\\<(.*?)\\>/', $ref, $matches)) { foreach ($matches[0] as $match) { $references[] = $match; } } } $refsResolved = []; $refCount = 0; foreach ($references as $messageId) { if (!$messageId) { continue; } if ($refCount >= REFERENCES_LIMIT) { break; } $refsResolved[] = $nntpClient->xpath($messageId); $refCount++; } } catch (Exception $e) { error($e->getMessage()); } head("{$group}: " . format_title($mail['headers']['subject'], 'utf-8')); start_article($mail, $refsResolved); $lines = preg_split("@(?<=\r\n|\n)@", $mail['text']); $insig = 0; foreach ($lines as $line) { # fix lines that started with a period and got escaped if (substr($line, 0, 2) == "..") { $line = substr($line, 1); } # this is some amazingly simplistic code to color quotes/signatures