#2 better header analysis

This commit is contained in:
n 2021-02-27 22:58:38 +01:00
parent cf916f6b8b
commit 6b37eaf919
Signed by: n
GPG key ID: E96086FC951DAE30

View file

@ -78,7 +78,10 @@ function hook_shaargem_render_editlink($data)
} else { } else {
fwrite($fp, $data['link']['url']."\r\n"); fwrite($fp, $data['link']['url']."\r\n");
$header = fgets($fp); $header = fgets($fp);
error_log("header:".$header); $ret = preg_match(",^(\d\d) (.*)\r\n$,", $header, $headers);
$status = $headers[1];
$meta = $headers[2];
error_log("status:".$status.", meta:".$meta);
if (strstr($header, "20 text/gemini")) if (strstr($header, "20 text/gemini"))
{ {
$nblines = 1; $nblines = 1;