summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/exe/spellcheck.php8
1 files changed, 5 insertions, 3 deletions
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 <matthiasgrimm@users.sourceforge.net>
*/
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)){