From 57638f2c05857bceea25909d0ef31ecf5f99b142 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sat, 10 Sep 2011 22:55:44 +0200 Subject: [PATCH] MDL-29081 add support for proxy in TinyMCE GoogleSpell plugin --- .../3.4.5/plugins/spellchecker/classes/GoogleSpell.php | 6 ++++++ .../tinymce/tiny_mce/3.4.5/plugins/spellchecker/config.php | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/lib/editor/tinymce/tiny_mce/3.4.5/plugins/spellchecker/classes/GoogleSpell.php b/lib/editor/tinymce/tiny_mce/3.4.5/plugins/spellchecker/classes/GoogleSpell.php index e0aa5f1eb81..29f7f085404 100644 --- a/lib/editor/tinymce/tiny_mce/3.4.5/plugins/spellchecker/classes/GoogleSpell.php +++ b/lib/editor/tinymce/tiny_mce/3.4.5/plugins/spellchecker/classes/GoogleSpell.php @@ -79,6 +79,12 @@ class GoogleSpell extends SpellChecker { curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); + if (!empty($this->_config['GoogleSpell.proxy'])) { + curl_setopt($ch, CURLOPT_PROXY, $this->_config['GoogleSpell.proxy']); + if (!empty($this->_config['GoogleSpell.proxyport'])) { + curl_setopt($ch, CURLOPT_PROXYPORT, $this->_config['GoogleSpell.proxyport']); + } + } $xml = curl_exec($ch); curl_close($ch); } else { diff --git a/lib/editor/tinymce/tiny_mce/3.4.5/plugins/spellchecker/config.php b/lib/editor/tinymce/tiny_mce/3.4.5/plugins/spellchecker/config.php index be64e8d0e6e..42e373c64c2 100644 --- a/lib/editor/tinymce/tiny_mce/3.4.5/plugins/spellchecker/config.php +++ b/lib/editor/tinymce/tiny_mce/3.4.5/plugins/spellchecker/config.php @@ -14,6 +14,10 @@ require_once(dirname(dirname(dirname(dirname(dirname(dirname(dirname(dirname(__F //$config['general.engine'] = 'PSpellShell'; //$config['general.remote_rpc_url'] = 'http://some.other.site/some/url/rpc.php'; + // GoogleSpell settings + $config['GoogleSpell.proxy'] = isset($CFG->proxyhost) ? $CFG->proxyhost : ''; + $config['GoogleSpell.proxyport'] = isset($CFG->proxyport) ? $CFG->proxyport : ''; + if ($config['general.engine'] === 'PSpell' or $config['general.engine'] === 'PSpellShell') { // PSpell settings $config['PSpell.mode'] = PSPELL_FAST; -- 2.43.0