From e1b80655c063a49d8762da43baee81198a5da1ff Mon Sep 17 00:00:00 2001 From: andi Date: Thu, 9 Jun 2005 20:37:09 +0200 Subject: spellchecker fix for eating whitespaces darcs-hash:20050609183709-9977f-daf9d77db759dc3dab0f62df8aee9ca33bfa52e5.gz --- lib/exe/spellcheck.php | 3 ++- lib/scripts/tw-sack.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') 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("=
=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) {} } -- cgit v1.2.3