Exemple #1
0
        } else {
            $error = 'Ошибка при сохранеии стоп-слов';
        }
    } else {
        $sStopWords = implode(', ', stop_words::getAdminStopWords(false));
    }
} else {
    // Запрещенные выражения
    if ($cmd == 'go') {
        $sStopRegex = clearInputText(__paramInit('array', null, 'regex', ''));
        $sTestText = clearInputText(__paramInit('array', null, 'test', ''));
        $sBadRegex = stop_words::validateAdminStopRegex($sStopRegex);
        if (!$sBadRegex) {
            $action = __paramInit('string', null, 'action', '');
            if ($action == 'update') {
                if (stop_words::updateAdminStopRegex($sStopRegex)) {
                    $_SESSION['admin_stop_words_success'] = TRUE;
                    header('Location: /siteadmin/stop_words/');
                    exit;
                } else {
                    $error = 'Ошибка при сохранеии стоп-слов';
                }
            } else {
                $stop_words->setStopRegex($sStopRegex);
                $sUserMode = $stop_words->replace($sTestText, 'html', false);
                $sAdminMode = $stop_words->replace($sTestText, 'html', true);
            }
        } else {
            $error = 'Выражение "' . $sBadRegex . '" не корректно';
        }
    } else {