diff options
author | alecpl <alec@alec.pl> | 2009-07-23 12:12:27 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2009-07-23 12:12:27 +0000 |
commit | ee258ce15870e6cb4b733087368a062b5fd66b52 (patch) | |
tree | 9b52d654f3abdbcba90db483a7970c5d9c308b44 /program/steps/mail/spell_pspell.inc | |
parent | a01b3bf9aee82b142724eb769a40a4d6df5d9e26 (diff) |
- performance fix: don't check mbstring functions existence too often
Diffstat (limited to 'program/steps/mail/spell_pspell.inc')
-rw-r--r-- | program/steps/mail/spell_pspell.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/program/steps/mail/spell_pspell.inc b/program/steps/mail/spell_pspell.inc index 8e574a62d..717b92ee5 100644 --- a/program/steps/mail/spell_pspell.inc +++ b/program/steps/mail/spell_pspell.inc @@ -49,13 +49,13 @@ $words = preg_split('/[ !"#$%&()*+\\,-.\/\n:;<=>?@\[\]^_{|}]+/', $text, NULL, P $plink = pspell_new(get_input_value('lang', RCUBE_INPUT_GET), null, null, RCMAIL_CHARSET, PSPELL_FAST); // send output -$out = '<?xml version="1.0" encoding="'.RCMAIL_CHARSET.'"?><spellresult charschecked="'.rc_strlen($text).'">'; +$out = '<?xml version="1.0" encoding="'.RCMAIL_CHARSET.'"?><spellresult charschecked="'.mb_strlen($text).'">'; $diff = 0; foreach ($words as $w) { $word = trim($w[0]); $pos = $w[1] - $diff; - $len = rc_strlen($word); + $len = mb_strlen($word); if ($word && $plink && !pspell_check($plink, $word)) { $suggestions = pspell_suggest($plink, $word); if (sizeof($suggestions)>10) |