1
0
Fork 0
forked from mirror/pixelfed

Update AP Inbox, fix url parser

This commit is contained in:
Daniel Supernault 2020-11-18 19:54:09 -07:00
parent 4b90b1e0df
commit 72a1a1ea19
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -287,12 +287,12 @@ class Inbox
}
}
if(filter_var($msg, FILTER_VALIDATE_URL)) {
if(Helpers::validateUrl($msg)) {
if(filter_var($msgText, FILTER_VALIDATE_URL)) {
if(Helpers::validateUrl($msgText)) {
$dm->type = 'link';
$dm->meta = [
'domain' => parse_url($msg, PHP_URL_HOST),
'local' => parse_url($msg, PHP_URL_HOST) ==
'domain' => parse_url($msgText, PHP_URL_HOST),
'local' => parse_url($msgText, PHP_URL_HOST) ==
parse_url(config('app.url'), PHP_URL_HOST)
];
$dm->save();