%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 3.137.187.71 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 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, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/esol.importexportexcel/lib/mail/ |
Upload File : |
<?php namespace Bitrix\KdaImportexcel; use Bitrix\Main\Localization\Loc; Loc::loadMessages(__FILE__); class MailUtil { public static function convertCharset($str, $from, $to) { $from = trim(strtolower($from)); $to = trim(strtolower($to)); if (in_array($from, array('utf-8', 'utf8'))) { $regex = '/ ([\x00-\x7F] |[\xC2-\xDF][\x80-\xBF] |\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]) |(\xE0[\xA0-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]|\xED[\x80-\x9F] |\xF0[\x90-\xBF][\x80-\xBF]{0,2}|[\xF1-\xF3][\x80-\xBF]{1,3}|\xF4[\x80-\x8F][\x80-\xBF]{0,2} |[\x80-\xFF]) /x'; $str = preg_replace_callback($regex, function ($matches) { return isset($matches[2]) ? str_repeat('?', \CUtil::binStrlen($matches[2])) : $matches[1]; }, $str); } if ($result = \Bitrix\Main\Text\Encoding::convertEncoding($str, $from, $to, $error)) $str = $result; else addMessage2Log(sprintf('Failed to convert email part. (%s -> %s : %s)', $from, $to, $error)); return $str; } public static function uue_decode($str) { preg_match("/begin [0-7]{3} .+?\r?\n(.+)?\r?\nend/i", $str, $reg); $str = $reg[1]; $res = ''; $str = preg_split("/\r?\n/", trim($str)); $strlen = count($str); for ($i = 0; $i < $strlen; $i++) { $pos = 1; $d = 0; $len= (int)(((ord(substr($str[$i],0,1)) -32) - ' ') & 077); while (($d + 3 <= $len) AND ($pos + 4 <= strlen($str[$i]))) { $c0 = (ord(substr($str[$i],$pos,1)) ^ 0x20); $c1 = (ord(substr($str[$i],$pos+1,1)) ^ 0x20); $c2 = (ord(substr($str[$i],$pos+2,1)) ^ 0x20); $c3 = (ord(substr($str[$i],$pos+3,1)) ^ 0x20); $res .= chr(((($c0 - ' ') & 077) << 2) | ((($c1 - ' ') & 077) >> 4)). chr(((($c1 - ' ') & 077) << 4) | ((($c2 - ' ') & 077) >> 2)). chr(((($c2 - ' ') & 077) << 6) | (($c3 - ' ') & 077)); $pos += 4; $d += 3; } if (($d + 2 <= $len) && ($pos + 3 <= strlen($str[$i]))) { $c0 = (ord(substr($str[$i],$pos,1)) ^ 0x20); $c1 = (ord(substr($str[$i],$pos+1,1)) ^ 0x20); $c2 = (ord(substr($str[$i],$pos+2,1)) ^ 0x20); $res .= chr(((($c0 - ' ') & 077) << 2) | ((($c1 - ' ') & 077) >> 4)). chr(((($c1 - ' ') & 077) << 4) | ((($c2 - ' ') & 077) >> 2)); $pos += 3; $d += 2; } if (($d + 1 <= $len) && ($pos + 2 <= strlen($str[$i]))) { $c0 = (ord(substr($str[$i],$pos,1)) ^ 0x20); $c1 = (ord(substr($str[$i],$pos+1,1)) ^ 0x20); $res .= chr(((($c0 - ' ') & 077) << 2) | ((($c1 - ' ') & 077) >> 4)); } } return $res; } function ByteXOR($a,$b,$l) { $c=""; for($i=0;$i<$l;$i++) $c .= $a[$i]^$b[$i]; return($c); } function BinMD5($val) { return(pack("H*",md5($val))); } }