summaryrefslogtreecommitdiff
path: root/lib/exe
diff options
context:
space:
mode:
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);