summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-06-09 20:37:09 +0200
committerandi <andi@splitbrain.org>2005-06-09 20:37:09 +0200
commite1b80655c063a49d8762da43baee81198a5da1ff (patch)
treede48d780a81d1d3462841e310ecc6557407fbe99
parenta898c721e634fd07b5fff0fd3b0e5b1295236d8a (diff)
downloadrpg-e1b80655c063a49d8762da43baee81198a5da1ff.tar.gz
rpg-e1b80655c063a49d8762da43baee81198a5da1ff.tar.bz2
spellchecker fix for eating whitespaces
darcs-hash:20050609183709-9977f-daf9d77db759dc3dab0f62df8aee9ca33bfa52e5.gz
-rw-r--r--lib/exe/spellcheck.php3
-rw-r--r--lib/scripts/tw-sack.js2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/exe/spellcheck.php b/lib/exe/spellcheck.php
index bdd6789d4..df4f134f4 100644
--- a/lib/exe/spellcheck.php
+++ b/lib/exe/spellcheck.php
@@ -164,7 +164,8 @@ function spell_formatword($word,$suggestions=null){
function spell_resume(){
$text = $_POST['data'];
- $text = preg_replace("/(\r\n|\n|\r)/", "", $text);
+ //some browsers insert newlines instead of spaces
+ $text = preg_replace("/(\r\n|\n|\r)/", ' ', $text);
$text = preg_replace("=<br */?>=i", "\n", $text);
// remove HTML tags
diff --git a/lib/scripts/tw-sack.js b/lib/scripts/tw-sack.js
index f9b8f247f..1480ca41c 100644
--- a/lib/scripts/tw-sack.js
+++ b/lib/scripts/tw-sack.js
@@ -90,7 +90,7 @@ function sack(file){
}
if (this.method == "POST"){
try {
- this.xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded')
+ this.xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
} catch (e) {}
}