summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-11-26 14:41:56 +0100
committerAndreas Gohr <andi@splitbrain.org>2005-11-26 14:41:56 +0100
commit1e96e0afaf8e3d2f03353a2b39b94abada36c74f (patch)
tree2172bea64572f4f4e44ca9b345aea58cfd1171fe
parent85cf819573ef2051171653402428ec33f0a9f4a6 (diff)
downloadrpg-1e96e0afaf8e3d2f03353a2b39b94abada36c74f.tar.gz
rpg-1e96e0afaf8e3d2f03353a2b39b94abada36c74f.tar.bz2
preserve spaces in spellchecker #620
darcs-hash:20051126134156-7ad00-8ad7d27dfa1e0e2ca672065f96bb7031c34a0056.gz
-rw-r--r--lib/exe/spellcheck.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/exe/spellcheck.php b/lib/exe/spellcheck.php
index 4bb08fd88..6d1a03910 100644
--- a/lib/exe/spellcheck.php
+++ b/lib/exe/spellcheck.php
@@ -112,6 +112,9 @@ function spell_check() {
$string = preg_replace("/(\015\012)|(\015)/","\012",$string);
$string = htmlspecialchars($string);
+ // make sure multiple spaces are kept
+ $string = preg_replace('/ /','&nbsp; ',$string);
+
// we need the text as array later
$data = explode("\n",$string);
@@ -243,6 +246,9 @@ function spell_resume(){
// restore quoted special chars
$text = unhtmlspecialchars($text);
+ // restore spaces
+ $text = preg_replace('/&nbsp;/',' ',$text);
+
// check if UTF-8 is accepted
if(!$_POST['utf8']){
// protect '&' (gets removed in JS later)