#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

@ -61,8 +61,14 @@ function shaargem_init($conf)
* @return array altered $data.
*/
function hook_shaargem_render_editlink($data)
{
// 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];
}
}