summaryrefslogtreecommitdiffstats
path: root/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-05-21 18:37:58 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-05-21 18:37:58 +0000
commit89fe0ff804e7c6497ebacc8b341ac89974f6f255 (patch)
tree3fce310b29c685008fdbb75c5ab531bc3a6ae12a /wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php
parenta139071806ba941346a109fbefb2d5f22bae1cc4 (diff)
downloadwordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.tar.gz
wordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.tar.xz
wordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.zip
WP Merge to rev 5499, this is a big one! Test it before you put it live!
Test only, not for production use yet git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@972 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php')
-rwxr-xr-xwp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php30
1 files changed, 17 insertions, 13 deletions
diff --git a/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php b/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php
index cf3d800..0127ff1 100755
--- a/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php
+++ b/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php
@@ -78,19 +78,8 @@ class TinyGoogleSpell {
$header .= $xml;
//$this->_debugData($xml);
- // 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 {
+ // Use curl if it exists
+ if (function_exists('curl_init')) {
// Use curl
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
@@ -99,6 +88,21 @@ class TinyGoogleSpell {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$xml = curl_exec($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);