We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/** * Fetches a URI and parses it for Open Graph data, returns * false on error. * * @param $URI URI to page to parse for Open Graph data * @return OpenGraph */ static public function fetch($URI) { try { $curl = curl_init($URI); if ($curl === false) { throw new Exception('failed to initialize'); } curl_setopt($curl, CURLOPT_FAILONERROR, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_TIMEOUT, 15); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); $response = curl_exec($curl); if ($response === false) { throw new Exception(curl_error($curl), curl_errno($curl)); } curl_close($curl); if (!empty($response)) { return self::_parse($response); } else { return false; } } catch (Exception $e) { trigger_error(sprintf( 'Curl failed with error #%d: %s', $e->getCode(), $e->getMessage()), E_USER_ERROR); } }
This got it working for me after checking cURL manually and then with problems with the SSL.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This got it working for me after checking cURL manually and then with problems with the SSL.
The text was updated successfully, but these errors were encountered: