src/mako/view/renderers/traits/EscaperTrait.php
protected function cssEscaper(array $matches): string
	{
		$chr = $matches[0];

		if(strlen($chr) === 1)
		{
			$ord = ord($chr);
		}
		else
		{
			$chr = mb_convert_encoding($chr, 'UTF-16BE', 'UTF-8');

			$ord = hexdec(bin2hex($chr));
		}

		return sprintf('\\%X ', $ord);
	}
protected function cssEscaper(array $matches): string
	{
		$chr = $matches[0];

		if(strlen($chr) === 1)
		{
			$ord = ord($chr);
		}
		else
		{
			$chr = mb_convert_encoding($chr, 'UTF-16BE', 'UTF-8');

			$ord = hexdec(bin2hex($chr));
		}

		return sprintf('\\%X ', $ord);
	}
protected function cssEscaper ( array $ matches ) : string { $ chr = $ matches [ 0 ] ; if ( strlen ( $ chr ) === 1 ) { $ ord = ord ( $ chr ) ; } else { $ chr = mb_convert_encoding ( $ chr , 'UTF-16BE' , 'UTF-8' ) ; $ ord = hexdec ( bin2hex ( $ chr ) ) ; } return sprintf ( '\\%X ' , $ ord ) ; }
Escapes characters for use in a CSS context.

(This method contains code from the SecurityMultiTool library).

@param  array  $matches Regex matches
@return string
Escapes characters for use in a CSS context .