diff options
| author | roundcube <roundcube@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2006-05-01 16:27:19 +0000 |
|---|---|---|
| committer | roundcube <roundcube@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2006-05-01 16:27:19 +0000 |
| commit | 2e1bb649248ce177fc1a4ea7c7c7c4745dc30a5a (patch) | |
| tree | 674d859c5ca4becae28140f19e9f47dc4bfe0068 /roundcubemail/program/steps/mail/spell.inc | |
| parent | 71e9f75c2be6c59bac0c514d6ef356bea8391ade (diff) | |
Started integrating GoogieSpell
git-svn-id: https://svn.roundcube.net/trunk@214 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/spell.inc')
| -rw-r--r-- | roundcubemail/program/steps/mail/spell.inc | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/roundcubemail/program/steps/mail/spell.inc b/roundcubemail/program/steps/mail/spell.inc new file mode 100644 index 000000000..2ba524e6a --- /dev/null +++ b/roundcubemail/program/steps/mail/spell.inc @@ -0,0 +1,50 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | program/steps/mail/spell.inc | + | | + | This file is part of the RoundCube Webmail client | + | Copyright (C) 2005, RoundCube Dev. - Switzerland | + | Licensed under the GNU GPL | + | | + | PURPOSE: | + | Submit request to Google's spell checking engine | + | | + | CREDITS: | + | Script from GoogieSpell by amix.dk | + | | + +-----------------------------------------------------------------------+ + | Author: Thomas Bruederli <roundcube@gmail.com> | + +-----------------------------------------------------------------------+ + + $Id$ + +*/ + +$REMOTE_REQUEST = TRUE; + +$google = "www.google.com"; +$lang = $_GET['lang']; +$path = "/tbproxy/spell?lang=$lang"; +$data = file_get_contents('php://input'); +$store = ""; + +if ($fp = fsockopen($google, 80, $errno, $errstr, 30)) + { + $out = "POST $path HTTP/1.0\r\n"; + $out .= "Host: $google\r\n"; + $out .= "Content-Length: " . strlen($data) . "\r\n"; + $out .= "Content-type: application/x-www-form-urlencoded\r\n"; + $out .= "Connection: Close\r\n\r\n"; + $out .= $data; + fwrite($fp, $out); + while (!feof($fp)) + $store .= fgets($fp, 128); + fclose($fp); + } + +print $store; +exit; + +?>
\ No newline at end of file |
