• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/ui/imageeditor/proxy.php
  • Класс: BitrixMainUIImageEditorProxy
  • Вызов: Proxy::__construct
public function __construct($url, $allowedHosts = [])
{
	$response = static::getResponse();

	if (!static::isAuthorized())
	{
		$response->setStatus(401)->flush();
		die('Unauthorized');
	}

	if (is_array($allowedHosts))
	{
		$this->allowedHosts = array_filter($allowedHosts, function($item) {
			return is_string($item) && !empty($item);
		});
	}

	$this->uri = new Uri($url);

	if (!$this->uri->getHost())
	{
		$this->uri->setHost(static::getCurrentHttpHost());
	}
}