Make WordPress Core

Changeset 5214


Ignore:
Timestamp:
04/09/2007 12:09:42 AM (18 years ago)
Author:
ryan
Message:

Google spell connect fix. Props Nazgul. see #3857

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php

    r4985 r5214  
    7979        //$this->_debugData($xml);
    8080
    81         // Use raw sockets
    82         $fp = fsockopen("ssl://" . $server, $port, $errno, $errstr, 30);
    83         if ($fp) {
    84             // Send request
    85             fwrite($fp, $header);
    86 
    87             // Read response
    88             $xml = "";
    89             while (!feof($fp))
    90                 $xml .= fgets($fp, 128);
    91 
    92             fclose($fp);
    93         } else {
     81        // Use curl if it exists
     82        if (function_exists('curl_init')) {
    9483            // Use curl
    9584            $ch = curl_init();
     
    10089            $xml = curl_exec($ch);
    10190            curl_close($ch);
     91        } else {
     92            // Use raw sockets
     93            $fp = fsockopen("ssl://" . $server, $port, $errno, $errstr, 30);
     94            if ($fp) {
     95                // Send request
     96                fwrite($fp, $header);
     97
     98                // Read response
     99                $xml = "";
     100                while (!feof($fp))
     101                    $xml .= fgets($fp, 128);
     102
     103                fclose($fp);
     104            } else
     105                echo "Could not open SSL connection to google.";
    102106        }
    103107
Note: See TracChangeset for help on using the changeset viewer.