mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-30 16:30:45 +00:00
Update AP Helpers
This commit is contained in:
parent
0ecb4133d5
commit
788c8bc640
1 changed files with 4 additions and 0 deletions
|
@ -170,6 +170,10 @@ class Helpers {
|
||||||
|
|
||||||
public static function fetchFromUrl($url)
|
public static function fetchFromUrl($url)
|
||||||
{
|
{
|
||||||
|
$url = self::validateUrl($url);
|
||||||
|
if($url == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$res = Zttp::withHeaders(self::zttpUserAgent())->get($url);
|
$res = Zttp::withHeaders(self::zttpUserAgent())->get($url);
|
||||||
$res = json_decode($res->body(), true, 8);
|
$res = json_decode($res->body(), true, 8);
|
||||||
if(json_last_error() == JSON_ERROR_NONE) {
|
if(json_last_error() == JSON_ERROR_NONE) {
|
||||||
|
|
Loading…
Reference in a new issue