#4 plugin breaks editing of web links title

This commit is contained in:
n 2021-02-28 11:14:14 +01:00
parent c47822f70e
commit adb34d2732
Signed by: n
GPG key ID: E96086FC951DAE30

View file

@ -62,7 +62,13 @@ function shaargem_init($conf)
*/
function hook_shaargem_render_editlink($data)
{
$data['link']['title'] = fetch_iri_title($data['link']['url']);
// fetch title only for gemini:// iris
if(isset($data['link']['url'])) {
if(strstr($data['link']['url'],"gemini://"))
{
$data['link']['title'] = fetch_iri_title($data['link']['url']);
}
}
return $data;
}
@ -194,6 +200,6 @@ function fetch_iri_title($iri)
}
fclose($fp);
}
}
return $title[1];
}
}