(int)$aVer[1], 'minor' => (int)$aVer[2], 'release' => (int)$aVer[3]); if($aVer['major'] >= 0 && $aVer['minor'] >= 60) { $aspell_args .= ' -H --encoding=utf-8'; } elseif(preg_match('/--encoding/', shell_exec('aspell 2>&1'))) { $aspell_args .= ' --mode=none --add-filter=sgml --encoding=utf-8'; } else { $aspell_args .= ' --mode=none --add-filter=sgml'; } // Personal dictionaries if(!isset($_REQUEST['p_dicts_path'])) { $_REQUEST['p_dicts_path'] = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'personal_dicts'; } if(file_exists($_REQUEST['p_dicts_path']) && is_writable($_REQUEST['p_dicts_path'])) { if(!isset($_REQUEST['p_dicts_name'])) { if(isset($_COOKIE['SpellChecker_p_dicts_name'])) { $_REQUEST['p_dicts_name'] = $_COOKIE['SpellChecker_p_dicts_name']; } else { $_REQUEST['p_dicts_name'] = uniqid('dict'); setcookie('SpellChecker_p_dicts_name', $_REQUEST['p_dicts_name'], time() + 60*60*24*365*10); } } $p_dict_path = $_REQUEST['p_dicts_path'] . DIRECTORY_SEPARATOR . $_REQUEST['p_dicts_name']; if(!file_exists($p_dict_path)) { mkdir($p_dict_path); chmod($p_dict_path, 02770); } if(file_exists($p_dict_path) && is_writable($p_dict_path)) { // Good To Go! $aspell_args .= ' --home-dir=' . $p_dict_path ; } } $aspelldictionaries = "$aspell dump dicts"; $aspellcommand = "$aspell $aspell_args < $temptext"; ?>