diff options
author | Andreas Gohr <andi@splitbrain.org> | 2005-07-01 09:39:19 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2005-07-01 09:39:19 +0200 |
commit | 6258cd9d2bd8824786e5485a93d483a1910a2dc4 (patch) | |
tree | 2f1f95ed82af24644cb252efb16b1e7c4b0b30d3 /lib | |
parent | 493a69295cd0593a35200757e54cb946f6081f51 (diff) | |
download | rpg-6258cd9d2bd8824786e5485a93d483a1910a2dc4.tar.gz rpg-6258cd9d2bd8824786e5485a93d483a1910a2dc4.tar.bz2 |
spellchecker fix for aspell <0.60
darcs-hash:20050701073919-7ad00-524018d3058613591acccea6691e81599e8193fb.gz
Diffstat (limited to 'lib')
-rw-r--r-- | lib/exe/spellcheck.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/exe/spellcheck.php b/lib/exe/spellcheck.php index 0a3a8403b..67448673c 100644 --- a/lib/exe/spellcheck.php +++ b/lib/exe/spellcheck.php @@ -165,8 +165,14 @@ function spell_check() { } $misspell = true; - $len = utf8_strlen($word); - $data[$lcnt] = utf8_substr_replace($data[$lcnt],spell_formatword($word,$sug),$off, $len); + //aspell < 0.60 returns singlebyte offsets + if($spell->version >= 600){ + $len = utf8_strlen($word); + $data[$lcnt] = utf8_substr_replace($data[$lcnt],spell_formatword($word,$sug),$off, $len); + }else{ + $len = strlen($word); + $data[$lcnt] = substr_replace($data[$lcnt],spell_formatword($word,$sug),$off, $len); + } }//end of output parsing |