Update AP helpers, fix sensitive bug

This commit is contained in:
Daniel Supernault 2024-02-04 03:16:57 -07:00
parent 09ca96cc2b
commit 00ed330cf3
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -548,10 +548,11 @@ class Helpers {
public static function getSensitive($activity, $url)
{
$id = isset($activity['id']) ? self::pluckval($activity['id']) : self::pluckval($url);
$url = isset($activity['url']) ? self::pluckval($activity['url']) : $id;
$urlDomain = parse_url($url, PHP_URL_HOST);
if(!$url || !strlen($url)) {
return true;
}
$urlDomain = parse_url($url, PHP_URL_HOST);
$cw = isset($activity['sensitive']) ? (bool) $activity['sensitive'] : false;
if(in_array($urlDomain, InstanceService::getNsfwDomains())) {