Changeset 1652 in subversion for trunk/roundcubemail/program/js/tiny_mce/plugins/spellchecker/classes/GoogleSpell.php
- Timestamp:
- Aug 15, 2008 6:00:33 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/js/tiny_mce/plugins/spellchecker/classes/GoogleSpell.php
r1651 r1652 54 54 $port = 443; 55 55 $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 } 58 66 59 67 // Setup XML request … … 75 83 // Use curl 76 84 $ch = curl_init(); 77 curl_setopt($ch, CURLOPT_URL, $url);85 curl_setopt($ch, CURLOPT_URL, ($ssl ? "https://" : "http://") . $server); 78 86 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 79 87 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header); … … 83 91 } else { 84 92 // Use raw sockets 85 $fp = fsockopen( "ssl://". $server, $port, $errno, $errstr, 30);93 $fp = fsockopen(($ssl ? "ssl://" : "") . $server, $port, $errno, $errstr, 30); 86 94 if ($fp) { 87 95 // Send request
Note: See TracChangeset
for help on using the changeset viewer.
