RSS Feed/News \XF\Service\Oembed::fetchJsonDataFromUrl may falsely report success

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
24,717
Points
823

Reputation:

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...
 
Status
Not open for further replies.
Top