From 57714e475ef1fc0aba080c1fbbf09b3590f06499 Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 15 Apr 2007 17:04:26 +0000 Subject: [PATCH] MDL-9300 The aspell spell-checker does not work in 1.8; merged from MOODLE_18_STABLE --- lib/speller/controls.html | 2 +- lib/speller/server-scripts/spellchecker.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/speller/controls.html b/lib/speller/controls.html index 868c64e07c..6f2831af81 100644 --- a/lib/speller/controls.html +++ b/lib/speller/controls.html @@ -55,7 +55,7 @@ function suggText() { } function init_spell() { - var controlForm = getElementById('spellcheck'); + var controlForm = document.getElementById('spellcheck'); // create a new controlWindow object controlWindowObj = new controlWindow( controlForm ); diff --git a/lib/speller/server-scripts/spellchecker.php b/lib/speller/server-scripts/spellchecker.php index 841da0346b..1831184698 100644 --- a/lib/speller/server-scripts/spellchecker.php +++ b/lib/speller/server-scripts/spellchecker.php @@ -2,6 +2,10 @@ include_once("../../../config.php"); require_login(); +if (empty($CFG->aspellpath)) { + error('Spellchecker not configured'); +} + header('Content-type: text/html; charset=utf-8'); // Speller pages script http://spellerpages.sourceforge.net/ @@ -35,9 +39,8 @@ function check_language($cmd) { global $CFG; - error_reporting(E_ALL); // for debug, final version shouldn't have this... clearstatcache(); - $current_lang = current_language(); + $current_lang = str_replace('_utf8', '', current_language()); $output = ''; if(!($handle = popen($cmd .' dump dicts', 'r'))) { -- 2.39.5