Update AP helpers, add forceBanCheck param to validateUrl method

This commit is contained in:
Daniel Supernault 2024-09-07 02:14:45 -06:00
parent 9904d05fbf
commit 42424028b0
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -155,7 +155,7 @@ class Helpers
return in_array($url, $audience['to']) || in_array($url, $audience['cc']);
}
public static function validateUrl($url = null, $disableDNSCheck = false)
public static function validateUrl($url = null, $disableDNSCheck = false, $forceBanCheck = false)
{
if (is_array($url) && ! empty($url)) {
$url = $url[0];
@ -212,7 +212,7 @@ class Helpers
}
}
if ($disableDNSCheck !== true && app()->environment() === 'production') {
if ($forceBanCheck || $disableDNSCheck !== true && app()->environment() === 'production') {
$bannedInstances = InstanceService::getBannedDomains();
if (in_array($host, $bannedInstances)) {
return false;
@ -739,7 +739,7 @@ class Helpers
$width = isset($media['width']) ? $media['width'] : false;
$height = isset($media['height']) ? $media['height'] : false;
$media = new Media();
$media = new Media;
$media->blurhash = $blurhash;
$media->remote_media = true;
$media->status_id = $status->id;