- $new_lang_words = $lang_words;
- /**
- * Write the dictionary back to the disk.
- */
- $langs=sqspell_getSettings($words);
- $words_dic = "# SquirrelSpell User Dictionary $SQSPELL_VERSION\n# "
- . "Last Revision: " . date("Y-m-d") . "\n# LANG: "
- . join(", ", $langs) . "\n";
- for ($i=0; $i<sizeof($langs); $i++){
- /**
- * Only rewrite the contents of the selected language.
- * Otherwise just write the contents back.
- */
- if ($langs[$i]==$sqspell_use_app) {
- $lang_words = $new_lang_words;
- } else {
- $lang_words = sqspell_getLang($words, $langs[$i]);
- }
- if ($lang_words) {
- $words_dic .= $lang_words;
- }
+
+ // rebuild dictionary
+ $new_words_ary = array();
+ foreach ($lang_words as $word){
+ if (! in_array($word,$words_ary)) {
+ $new_words_ary[]=$word;
+ }