mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update AP helpers, fix sensitive bug
This commit is contained in:
parent
09ca96cc2b
commit
00ed330cf3
1 changed files with 4 additions and 3 deletions
|
@ -548,10 +548,11 @@ class Helpers {
|
||||||
|
|
||||||
public static function getSensitive($activity, $url)
|
public static function getSensitive($activity, $url)
|
||||||
{
|
{
|
||||||
$id = isset($activity['id']) ? self::pluckval($activity['id']) : self::pluckval($url);
|
if(!$url || !strlen($url)) {
|
||||||
$url = isset($activity['url']) ? self::pluckval($activity['url']) : $id;
|
return true;
|
||||||
$urlDomain = parse_url($url, PHP_URL_HOST);
|
}
|
||||||
|
|
||||||
|
$urlDomain = parse_url($url, PHP_URL_HOST);
|
||||||
$cw = isset($activity['sensitive']) ? (bool) $activity['sensitive'] : false;
|
$cw = isset($activity['sensitive']) ? (bool) $activity['sensitive'] : false;
|
||||||
|
|
||||||
if(in_array($urlDomain, InstanceService::getNsfwDomains())) {
|
if(in_array($urlDomain, InstanceService::getNsfwDomains())) {
|
||||||
|
|
Loading…
Reference in a new issue