facebookarchive / php-graph-sdk

The Facebook SDK for PHP provides a native interface to the Graph API and Facebook Login. https://developers.facebook.com/docs/php
Other
3.17k stars 1.95k forks source link

FB Login -> Error: Undefined offset: 1 #1170

Closed amsmithmt closed 4 years ago

amsmithmt commented 4 years ago

Hi,

A new installation of the SDK, I'm getting Error: Undefined offset: 1 on facebook login during the callback.

Script file referenced is vendor\facebook\graph-sdk\src\Facebook\Http\GraphRawResponse.php

Line 108

Below code in the graph sciprt file:

public function setHttpResponseCodeFromHeader($rawResponseHeader)
    {
        preg_match('|HTTP/\d\.\d\s+(\d+)\s+.*|', $rawResponseHeader, $match);
        $this->httpResponseCode = (int)$match[1];
    }

Does anyone have a suggestion for fixing this?

The callback itself comes as https://mywebsite/facebook/callback?code=

Thanks