Merge pull request #12735 from MrPetovan/bug/fatal-errors
Address a couple of Fatal errors
This commit is contained in:
commit
fc46778a00
2 changed files with 2 additions and 2 deletions
|
@ -583,7 +583,7 @@ class Photo
|
|||
$photo_failure = false;
|
||||
|
||||
$filename = basename($image_url);
|
||||
if (!empty($image_url)) {
|
||||
if (!empty($image_url) && @parse_url($image_url, PHP_URL_HOST)) {
|
||||
$ret = DI::httpClient()->get($image_url, HttpClientAccept::IMAGE);
|
||||
Logger::debug('Got picture', ['Content-Type' => $ret->getHeader('Content-Type'), 'url' => $image_url]);
|
||||
$img_str = $ret->getBody();
|
||||
|
|
|
@ -45,7 +45,7 @@ class Stats extends BaseDataTransferObject
|
|||
{
|
||||
if (!empty($config->get('system', 'nodeinfo'))) {
|
||||
$this->user_count = intval(DI::keyValue()->get('nodeinfo_total_users'));
|
||||
$this->status_count = DI::keyValue()->get('nodeinfo_local_posts') + DI::keyValue()->get('nodeinfo_local_comments');
|
||||
$this->status_count = (int)DI::keyValue()->get('nodeinfo_local_posts') + (int)DI::keyValue()->get('nodeinfo_local_comments');
|
||||
$this->domain_count = $database->count('gserver', ["`network` in (?, ?) AND NOT `failed` AND NOT `blocked`", Protocol::DFRN, Protocol::ACTIVITYPUB]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue