Make WordPress Core

Ticket #3857: 3857upstream.diff

File 3857upstream.diff, 1.3 KB (added by Nazgul, 18 years ago)
  • wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php

     
    7878        $header .= $xml;
    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();
    9685                        curl_setopt($ch, CURLOPT_URL,$url);
     
    9988                        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    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
    104108                //$this->_debugData($xml);