uawdijnntqw1x1x1
IP : 13.58.36.197
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
yar.axolotls.ru
/
1c9cb
/
..
/
bitrix
/
modules
/
form
/
validators
/
val_text_len.php
/
/
<? IncludeModuleLangFile(__FILE__); class CFormValidatorTextLen { function GetDescription() { return array( "NAME" => "text_len", // unique validator string ID "DESCRIPTION" => GetMessage('FORM_VALIDATOR_VAL_TEXT_LEN_DESCRIPTION'), // validator description "TYPES" => array("text", "textarea", "password", "email", "url"), // list of types validator can be applied. "SETTINGS" => array("CFormValidatorTextLen", "GetSettings"), // method returning array of validator settings, optional "CONVERT_TO_DB" => array("CFormValidatorTextLen", "ToDB"), // method, processing validator settings to string to put to db, optional "CONVERT_FROM_DB" => array("CFormValidatorTextLen", "FromDB"), // method, processing validator settings from string from db, optional "HANDLER" => array("CFormValidatorTextLen", "DoValidate") // main validation method ); } function GetSettings() { return array( "LENGTH_FROM" => array( "TITLE" => GetMessage("FORM_VALIDATOR_VAL_TEXT_LEN_SETTINGS_LENGTH_FROM"), "TYPE" => "TEXT", "DEFAULT" => "0", ), "LENGTH_TO" => array( "TITLE" => GetMessage("FORM_VALIDATOR_VAL_TEXT_LEN_SETTINGS_LENGTH_TO"), "TYPE" => "TEXT", "DEFAULT" => "100", ), ); } function ToDB($arParams) { $arParams["LENGTH_FROM"] = intval($arParams["LENGTH_FROM"]); $arParams["LENGTH_TO"] = intval($arParams["LENGTH_TO"]); if ($arParams["LENGTH_FROM"] > $arParams["LENGTH_TO"]) { $tmp = $arParams["LENGTH_FROM"]; $arParams["LENGTH_FROM"] = $arParams["LENGTH_TO"]; $arParams["LENGTH_TO"] = $tmp; } return serialize($arParams); } function FromDB($strParams) { return unserialize($strParams); } function DoValidate($arParams, $arQuestion, $arAnswers, $arValues) { global $APPLICATION; foreach ($arValues as $value) { // check minimum length if (mb_strlen($value) < $arParams["LENGTH_FROM"]) { $APPLICATION->ThrowException(GetMessage("FORM_VALIDATOR_VAL_TEXT_LEN_ERROR_LESS")); return false; } // check maximum length if (mb_strlen($value) > $arParams["LENGTH_TO"]) { $APPLICATION->ThrowException(GetMessage("FORM_VALIDATOR_VAL_TEXT_LEN_ERROR_MORE")); return false; } } return true; } } AddEventHandler("form", "onFormValidatorBuildList", array("CFormValidatorTextLen", "GetDescription")); ?>
/var/www/axolotl/data/www/yar.axolotls.ru/1c9cb/../bitrix/modules/form/validators/val_text_len.php