• Модуль: mail
  • Путь к файлу: ~/bitrix/modules/mail/lib/helper/oauth.php
  • Класс: BitrixMailHelperOAuth
  • Вызов: OAuth::parseMeta
static function parseMeta($meta)
{
	$regex = sprintf(
		'/^x00(oauthb)x00(%s)x00([a-f0-9]+)$/',
		join(
			'|',
			array_map(
				function ($item)
				{
					return preg_quote($item, '/');
				},
				self::getKnownServices()
			)
		)
	);

	if (!preg_match($regex, $meta, $matches))
	{
		if (!preg_match('/^x00(oauth)x00(google|liveid)x00(d+)$/', $meta, $matches))
		{
			return null;
		}
	}

	return array(
		'type' => $matches[1],
		'service' => $matches[2],
		'key' => $matches[3],
	);
}