Ignore:
Timestamp:
Aug 15, 2008 6:00:33 PM (5 years ago)
Author:
thomasb
Message:

Respect spellcheck_uri in tinyMCE spellchecker (#1484196)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/js/tiny_mce/plugins/spellchecker/classes/GoogleSpell.php

    r1651 r1652  
    5454                $port = 443; 
    5555                $path = "/tbproxy/spell?lang=" . $lang . "&hl=en"; 
    56                 $host = "www.google.com"; 
    57                 $url = "https://" . $server; 
     56                $ssl = true; 
     57                 
     58                // spell check uri is configured (added by RoundCube) 
     59                if (!empty($this->_config['rpc_uri'])) { 
     60                        $a_uri = parse_url($this->_config['rpc_uri']); 
     61                        $ssl = ($a_uri['scheme']=='https' || $a_uri['scheme']=='ssl'); 
     62                        $port = $a_uri['port'] ? $a_uri['port'] : ($ssl ? 443 : 80); 
     63                        $server = $a_uri['host']; 
     64                        $path = $a_uri['path'] . ($a_uri['query'] ? '?'.$a_uri['query'] : '') . $lang; 
     65                } 
    5866 
    5967                // Setup XML request 
     
    7583                        // Use curl 
    7684                        $ch = curl_init(); 
    77                         curl_setopt($ch, CURLOPT_URL,$url); 
     85                        curl_setopt($ch, CURLOPT_URL, ($ssl ? "https://" : "http://") . $server); 
    7886                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    7987                        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header); 
     
    8391                } else { 
    8492                        // Use raw sockets 
    85                         $fp = fsockopen("ssl://" . $server, $port, $errno, $errstr, 30); 
     93                        $fp = fsockopen(($ssl ? "ssl://" : "") . $server, $port, $errno, $errstr, 30); 
    8694                        if ($fp) { 
    8795                                // Send request 
Note: See TracChangeset for help on using the changeset viewer.