Google spell connect fix. Props Nazgul. see #3857
git-svn-id: http://svn.automattic.com/wordpress/trunk@5214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bf3110bb49
commit
9442a8806b
|
@ -78,19 +78,8 @@ class TinyGoogleSpell {
|
||||||
$header .= $xml;
|
$header .= $xml;
|
||||||
//$this->_debugData($xml);
|
//$this->_debugData($xml);
|
||||||
|
|
||||||
// Use raw sockets
|
// Use curl if it exists
|
||||||
$fp = fsockopen("ssl://" . $server, $port, $errno, $errstr, 30);
|
if (function_exists('curl_init')) {
|
||||||
if ($fp) {
|
|
||||||
// Send request
|
|
||||||
fwrite($fp, $header);
|
|
||||||
|
|
||||||
// Read response
|
|
||||||
$xml = "";
|
|
||||||
while (!feof($fp))
|
|
||||||
$xml .= fgets($fp, 128);
|
|
||||||
|
|
||||||
fclose($fp);
|
|
||||||
} else {
|
|
||||||
// Use curl
|
// Use curl
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL,$url);
|
curl_setopt($ch, CURLOPT_URL,$url);
|
||||||
|
@ -99,6 +88,21 @@ class TinyGoogleSpell {
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||||
$xml = curl_exec($ch);
|
$xml = curl_exec($ch);
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
} else {
|
||||||
|
// Use raw sockets
|
||||||
|
$fp = fsockopen("ssl://" . $server, $port, $errno, $errstr, 30);
|
||||||
|
if ($fp) {
|
||||||
|
// Send request
|
||||||
|
fwrite($fp, $header);
|
||||||
|
|
||||||
|
// Read response
|
||||||
|
$xml = "";
|
||||||
|
while (!feof($fp))
|
||||||
|
$xml .= fgets($fp, 128);
|
||||||
|
|
||||||
|
fclose($fp);
|
||||||
|
} else
|
||||||
|
echo "Could not open SSL connection to google.";
|
||||||
}
|
}
|
||||||
|
|
||||||
//$this->_debugData($xml);
|
//$this->_debugData($xml);
|
||||||
|
|
Loading…
Reference in New Issue