示例#1
0
$dict = '';
if ($pref["aspell_{$atmail->Language}"]) {
    $dict = $aspellLanguageCodes[$atmail->Language];
}
ob_end_clean();
//$dict = 'en';
if (empty($dict)) {
    $lang = ucfirst($atmail->Language);
    header("Content-type: text/xml; charset: utf-8");
    echo "<Error>Spellcheck not available for {$lang} language</Error>\n";
    $atmail->end();
}
// only bother requiring if we pass authentication
require_once 'spellChecker.php';
$atmail->httpheaders();
$spellChecker = new spellChecker($dict, "{$atmail->username}@{$atmail->pop3host}", $pref['use_php_pspell']);
// Add word to our personal dict file
if ($_REQUEST['add']) {
    $personal = $_REQUEST['replace'] ? $_REQUEST['replace'] : $_REQUEST['wordreplace'];
    // Insert the entry into the database
    $spellChecker->addWord($atmail->Account, $personal);
}
if ($_REQUEST['ignore'] || $_REQUEST['change'] && $_REQUEST['wordreplace']) {
    // Ignore the word
    $spellChecker->ignoreWord($_REQUEST['wordreplace']);
}
// spell check the email
$_REQUEST['emailmessage'] = str_replace(array('<br>', '<BR>', '<br/>', '<BR/>', '</p>', '</P>'), "\n", $_REQUEST['emailmessage']);
// Remove any html entities and tags
$_REQUEST['emailmessage'] = preg_replace('/&\\w+;/', '', $_REQUEST['emailmessage']);
$_REQUEST['emailmessage'] = strip_tags($_REQUEST['emailmessage']);
示例#2
0
if (!$USER->CanDoOperation('fileman_edit_existent_files') || !check_freetrix_sessid()) {
    die;
}
require $_SERVER["DOCUMENT_ROOT"] . "/freetrix/modules/fileman/include.php";
require $_SERVER["DOCUMENT_ROOT"] . "/freetrix/modules/fileman/admin/fileman_spellChecker.php";
function replacer($str)
{
    $str = CFileMan::SecurePathVar($str);
    $str = preg_replace("/[^a-zA-Z0-9_\\.-\\+]/is", "_", $str);
    return $str;
}
$word = isset($_POST['word']) ? $_POST['word'] : false;
$lang = replacer(isset($_GET['BXLang']) ? $_GET['BXLang'] : 'en');
$use_pspell = isset($_GET['use_pspell']) ? $_GET['use_pspell'] : true;
$use_custom_spell = isset($_GET['use_custom_spell']) ? $_GET['use_custom_spell'] : true;
$SC = new spellChecker();
$path = replacer($_SERVER["DOCUMENT_ROOT"] . COption::GetOptionString('fileman', "user_dics_path", "/freetrix/modules/fileman/u_dics"));
if (!is_dir($path)) {
    mkdir($path, FX_DIR_PERMISSIONS);
}
$lang_path = $path . '/' . $lang;
if (!is_dir($lang_path)) {
    mkdir($lang_path, FX_DIR_PERMISSIONS);
}
if (COption::GetOptionString('fileman', "use_separeted_dics", "Y") == "Y") {
    $user_path = $lang_path . '/' . $USER->GetID();
    if (!is_dir($user_path)) {
        mkdir($user_path, FX_DIR_PERMISSIONS);
    }
    $path = $user_path;
} else {
示例#3
0
<?php

require $_SERVER["DOCUMENT_ROOT"] . "/freetrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/freetrix/modules/fileman/prolog.php";
if (!$USER->CanDoOperation('fileman_edit_existent_files')) {
    die;
}
require $_SERVER["DOCUMENT_ROOT"] . "/freetrix/modules/fileman/include.php";
require $_SERVER["DOCUMENT_ROOT"] . "/freetrix/modules/fileman/admin/fileman_spellChecker.php";
$wordList = isset($_POST['wordlist']) ? explode(",", $_POST['wordlist']) : false;
$arr = explode(",", $_POST['wordlist']);
$use_pspell = isset($_GET['usePspell']) ? $_GET['usePspell'] : "Y";
$use_custom_spell = isset($_GET['useCustomSpell']) ? $_GET['useCustomSpell'] : "Y";
$SC = new spellChecker();
$path = $_SERVER["DOCUMENT_ROOT"] . COption::GetOptionString('fileman', "user_dics_path", "/freetrix/modules/fileman/u_dics");
if (!is_dir($path)) {
    mkdir($path, FX_DIR_PERMISSIONS);
}
$lang = "en";
if (isset($_GET['BXLang'])) {
    $rsLang = CLanguage::GetList($by = "sort", $order = "desc");
    while ($arLang = $rsLang->Fetch()) {
        if ($_GET['BXLang'] == $arLang["LID"]) {
            $lang = $_GET['BXLang'];
            break;
        }
    }
}
$lang_path = $path . '/' . $lang;
if (!is_dir($lang_path)) {
    mkdir($lang_path, FX_DIR_PERMISSIONS);