Solved \XF\Service\Oembed::fetchJsonDataFromUrl may falsely report success

This topic has been solved
K

Kirby

Guest
PHP:

Code:
if ($response->getStatusCode() == 200)
{
    try
    {
        $json = json_decode($jsonText, true);

        if (!empty($json['title']))
        {
            $title = $json['title'];
        }
        else if (!empty($json['author_name']))
        {
            $title = $json['author_name'];
        }

        $validOembed = true;
    }
    catch (\Exception $e)
    {
        $error = \XF::phraseDeferred('returned_data_is_not_json');
    }

json_decode doesn't throw an...

Read more

Continue reading...