Support » Plugin: Flow-Flow Social Feed Stream » Proposed Patch: PHP 8.x Fatal Server Error When Authenticating FB

  • This also affects the paid Flow-Flow plugin on CodeCanyon.

    Currently, I have a site on PHP 8.0.x where it was encountering a fatal server error when returning back from Facebook when trying to authenticate & get a new token for FB & Instagram.

    It turns out that includes/db/FFDBManager.php currently has:

    
    $facebook_cache->save($_REQUEST['facebook_access_token'], time() + $_REQUEST['expires']);
    

    within the social_auth function that’s triggering a TypeError.

    This was fixed by changing this line into:

    
    $facebook_cache_time = time() + intval($_REQUEST['expires']);
    $facebook_cache->save($_REQUEST['facebook_access_token'], $facebook_cache_time);
    

    It technically might not be required to break the variable out of the function, but I did want to isolate that calculation to not be performed within the save function’s parameters, but this should make it more reliable overall.

    The key change was the fact that $_REQUEST['expires'] is now intval($_REQUEST['expires']). The TypeError was due to time() (an integer) being added to $_REQUEST['expires'] (a string), and newer PHP versions don’t auto-convert types in cases like this so intval is used to take care of that.

    I’d love to see this included in a future version of both this & the paid version of Flow-Flow (with the issue present for both [actually encountered this with the paid plugin first.])

Viewing 1 replies (of 1 total)
  • Thank you for your tips it helped and saved me so much time !
    You are right, it should be included in the next version.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.