mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-17 20:11:27 +00:00
Update AP helpers, add forceBanCheck param to validateUrl method
This commit is contained in:
parent
9904d05fbf
commit
42424028b0
1 changed files with 3 additions and 3 deletions
|
@ -155,7 +155,7 @@ class Helpers
|
||||||
return in_array($url, $audience['to']) || in_array($url, $audience['cc']);
|
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)) {
|
if (is_array($url) && ! empty($url)) {
|
||||||
$url = $url[0];
|
$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();
|
$bannedInstances = InstanceService::getBannedDomains();
|
||||||
if (in_array($host, $bannedInstances)) {
|
if (in_array($host, $bannedInstances)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -739,7 +739,7 @@ class Helpers
|
||||||
$width = isset($media['width']) ? $media['width'] : false;
|
$width = isset($media['width']) ? $media['width'] : false;
|
||||||
$height = isset($media['height']) ? $media['height'] : false;
|
$height = isset($media['height']) ? $media['height'] : false;
|
||||||
|
|
||||||
$media = new Media();
|
$media = new Media;
|
||||||
$media->blurhash = $blurhash;
|
$media->blurhash = $blurhash;
|
||||||
$media->remote_media = true;
|
$media->remote_media = true;
|
||||||
$media->status_id = $status->id;
|
$media->status_id = $status->id;
|
||||||
|
|
Loading…
Reference in a new issue