summaryrefslogtreecommitdiff
path: root/lib/exe
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-06-08 20:27:58 +0200
committerandi <andi@splitbrain.org>2005-06-08 20:27:58 +0200
commit95657bc6773c23c04843d51d5224df0bbd5191f0 (patch)
tree119d23ef8bfb8977f79acc114e016ea66691d2c6 /lib/exe
parent2765ac2310959056fc3548fbdd745258de6c048c (diff)
downloadrpg-95657bc6773c23c04843d51d5224df0bbd5191f0.tar.gz
rpg-95657bc6773c23c04843d51d5224df0bbd5191f0.tar.bz2
Spellchecker fixes
The spellchecker now works in IE6, Firefox and Opera 8 :-) SACK was updated to the latest release (plus a minor fix) Proper UTF-8 headers were added to the AJAX PHP backends darcs-hash:20050608182758-9977f-1eacd0ba9993a62f094433d982f668e38d17ba14.gz
Diffstat (limited to 'lib/exe')
-rw-r--r--lib/exe/ajax.php5
-rw-r--r--lib/exe/spellcheck.php9
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php
index 02911b858..c75bce52d 100644
--- a/lib/exe/ajax.php
+++ b/lib/exe/ajax.php
@@ -17,12 +17,15 @@ require_once(DOKU_INC.'inc/common.php');
require_once(DOKU_INC.'inc/pageutils.php');
require_once(DOKU_INC.'inc/auth.php');
+header('Content-Type: text/html; charset=utf-8');
+
+
//call the requested function
$call = 'ajax_'.$_POST['call'];
if(function_exists($call)){
$call();
}else{
- print "The called function does not exist!";
+ print "The called function '".htmlspecialchars($call)."' does not exist!";
}
/**
diff --git a/lib/exe/spellcheck.php b/lib/exe/spellcheck.php
index c6a883e32..bdd6789d4 100644
--- a/lib/exe/spellcheck.php
+++ b/lib/exe/spellcheck.php
@@ -51,6 +51,8 @@ require_once (DOKU_INC.'inc/init.php');
require_once (DOKU_INC.'inc/utf8.php');
require_once (DOKU_INC.'inc/aspell.php');
+header('Content-Type: text/html; charset=utf-8');
+
//create spell object
$spell = new Aspell($conf['lang'],'null','utf-8');
$spell->setMode(PSPELL_FAST);
@@ -84,7 +86,12 @@ function spell_check() {
// $string = preg_replace('!()!e','spellclean(\\1)',$string);
// run aspell in terse sgml mode
- $spell->runAspell("!\n+sgml\n".$string,$out,$err);
+ if(!$spell->runAspell("!\n+sgml\n".$string,$out,$err)){
+ print '2'; //to indicate an error
+ print "An error occured while trying to run the spellchecker:\n";
+ print $err;
+ return;
+ }
// go through the result
$lines = split("\n",$out);