uawdijnntqw1x1x1
IP : 18.224.137.108
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
/
samara.axolotls.ru
/
bitrix
/
modules
/
sender
/
lib
/
recipient
/
normalizer.php
/
/
<?php /** * Bitrix Framework * @package bitrix * @subpackage sender * @copyright 2001-2012 Bitrix */ namespace Bitrix\Sender\Recipient; use Bitrix\Main\Localization\Loc; use Bitrix\Main\PhoneNumber; Loc::loadMessages(__FILE__); /** * Class Normalizer * @package Bitrix\Sender\Recipient */ class Normalizer { /** * Normalize. * * @param string $code Code. * @param integer $typeId Type ID. * @return string|null */ public static function normalize($code, $typeId = Type::EMAIL) { if (!$code) { return null; } switch ($typeId) { case Type::IM: return self::normalizeIm($code); case Type::PHONE: return self::normalizePhone($code); case Type::CRM_COMPANY_ID: case Type::CRM_CONTACT_ID: return self::normalizeCrmEntityId($code); case Type::EMAIL: default: return self::normalizeEmail($code); } } /** * Normalize email. * * @param string $code Code. * @return string */ public static function normalizeEmail($code) { return trim(mb_strtolower($code)); } /** * Normalize phone number. * * @param string $phone Phone number. * @return string|null */ public static function normalizePhone($phone) { return PhoneNumber\Parser::getInstance() ->parse($phone) ->format(PhoneNumber\Format::E164); } /** * Normalize im. * * @param string $code Code. * @return string */ public static function normalizeIm($code) { $code = trim($code); if (mb_strpos($code, 'imol|') === 0) { $code = mb_substr($code, 5); } return $code; } /** * Normalize Crm entity code. * * @param string $code Code. * @return string */ public static function normalizeCrmEntityId($code) { return preg_replace("/[^0-9]/", '', $code); } }
/var/www/axolotl/data/www/samara.axolotls.ru/bitrix/modules/sender/lib/recipient/normalizer.php