From f0481e4f9a2d86fad0757d829e3edbe64539cd61 Mon Sep 17 00:00:00 2001 From: andi Date: Fri, 17 Jun 2005 11:48:26 +0200 Subject: spellchecker fix for ignoring links darcs-hash:20050617094826-9977f-d2041cfe4d1698e2b5722cd16c6e6e4a6ac26ac3.gz --- lib/exe/spellcheck.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/exe') diff --git a/lib/exe/spellcheck.php b/lib/exe/spellcheck.php index 86e0e438e..5af5c43dd 100644 --- a/lib/exe/spellcheck.php +++ b/lib/exe/spellcheck.php @@ -77,6 +77,8 @@ if(function_exists($call)){ * @author Matthias Grimm */ function spaceslink($string, $check=""){ + $string = stripslashes($string); + $check = stripslashes($check); $result = str_pad($check,utf8_strlen($string)-2," ",STR_PAD_LEFT); return $result." "; } @@ -106,9 +108,9 @@ function spell_check() { $data = explode("\n",$string); // don't check links and medialinks for spelling errors - $string = preg_replace('/\{\{[^\|]*\|?(.*)\}\}/e','spaceslink("\\0","\\1")',$string); - $string = preg_replace('/\[\[[^\|]*\|?(.*)\]\]/e','spaceslink("\\0","\\1")',$string); - + $string = preg_replace('/\{\{(.*?)(\|(.*?))?(\}\})/e','spaceslink("\\0","\\3")',$string); + $string = preg_replace('/\[\[(.*?)(\|(.*?))?(\]\])/e','spaceslink("\\0","\\3")',$string); + // run aspell in terse sgml mode if(!$spell->runAspell($string,$out,$err,array('!','+html'))){ //if(!$spell->runAspell($string,$out,$err)){ -- cgit v1.2.3