From 1e6dfe497f883fb7c94874a81f2472f8134db0a5 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 26 Nov 2005 18:55:21 +0100 Subject: more fixes on spaces in spellcheck darcs-hash:20051126175521-7ad00-b836b220bf1cf5f50d881e13d52494dc4c71902e.gz --- lib/exe/spellcheck.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/exe/spellcheck.php b/lib/exe/spellcheck.php index 6d1a03910..fa84d11c0 100644 --- a/lib/exe/spellcheck.php +++ b/lib/exe/spellcheck.php @@ -122,8 +122,8 @@ function spell_check() { $string = preg_replace('/\{\{(.*?)(\|(.*?))?(\}\})/e','spaceslink("\\1","\\2")',$string); $string = preg_replace('/\[\[(.*?)(\|(.*?))?(\]\])/e','spaceslink("\\1","\\2")',$string); - // run aspell in terse sgml mode - if(!$spell->runAspell($string,$out,$err,array('!','+html'))){ + // run aspell in terse sgml mode, ignore nbsp as correct word + if(!$spell->runAspell($string,$out,$err,array('!','+html','@nbsp'))){ print '2'; //to indicate an error print "An error occured while trying to run the spellchecker:\n"; print $err; @@ -243,12 +243,12 @@ function spell_resume(){ // remove HTML tags $text = strip_tags($text); - // restore quoted special chars - $text = unhtmlspecialchars($text); - // restore spaces $text = preg_replace('/ /',' ',$text); + // restore quoted special chars + $text = unhtmlspecialchars($text); + // check if UTF-8 is accepted if(!$_POST['utf8']){ // protect '&' (gets removed in JS later) -- cgit v1.2.3