-1

My question is simple: How do i hide the warning message below so that users don't see it? It appears at the top of my site from time to time.

Warning: file_get_contents(https://graph.facebook.com/oauth/access_token?client_id=*****************&redirect_uri=&client_secret=******&code=*************************************************************************************) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in /home/content/**/*******/php/facebook/facebook-login.php on line 17

I am not worried about the warning as it doesn't seem to affect the functionality of my site and it only happens because the facebook token has expired.

I have tried for hours to resolve it properly by auto-renewing the expired token but had no luck.

4

1 回答 1

1

Well, if you only need to hide it, you can go to the php file (/home/content//***/php/facebook/facebook-login.php) and add the @ to line 17 to supress any errors from that function call. See: http://php.net/manual/en/language.operators.errorcontrol.php

Please consider the warning there, too.

Also be advised, that proper error handling with supressing (but logging) errors for the user and showing them if you visit your site as admin will be even better.

于 2012-12-31T03:17:49.660 回答