403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/main/lib/text/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/main/lib/text/emoji.php
<?php
namespace Bitrix\Main\Text;
/**
 * Bitrix Framework
 * @package bitrix
 * @subpackage main
 * @copyright 2001-2024 Bitrix
 */
class Emoji
{
	private static $emojiPattern = '%(?:
		\xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
		| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
		| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
	)%xs';

	public static function encode($text)
	{
		return self::replace($text, function ($m) {
			return ":".bin2hex($m[0]).":";
		});
	}

	public static function decode($text)
	{
		return preg_replace_callback("/:([A-F0-9]{8}):/isu", function ($m)
		{
			$result = hex2bin($m[1]);

			if (preg_match(self::$emojiPattern, $result))
			{
				return $result;
			}

			return $m[0];
		}, $text);
	}

	/**
	 * @param string $text
	 * @param callable $callback
	 *
	 * @return string|string[]|null
	 */
	public static function replace($text, $callback)
	{
		return preg_replace_callback(self::$emojiPattern, $callback, $text);
	}

	public static function getSaveModificator()
	{
		return array(
			array(__CLASS__, 'encode')
		);
	}

	public static function getFetchModificator()
	{
		return array(
			array(__CLASS__, 'decode')
		);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit