Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
uri.php
1<?php
3
5{
10 public function getUri()
11 {
12 if($this->user == '' && $this->host <> '')
13 {
14 return parent::getUri();
15 }
16
17 $url = "";
18 $url .= $this->scheme.':';
19
20 if($this->scheme !== 'callto' && $this->scheme !== 'mailto')
21 {
22 $url .= "//";
23 }
24
25 if($this->user <> '')
26 {
27 $url .= $this->user.':'.$this->pass.'@';
28 }
29
30 $url .= $this->getASCIIHost();
31
32 if(($this->scheme == "http" && $this->port <> 80) || ($this->scheme == "https" && $this->port <> 443))
33 {
34 $url .= ":".$this->port;
35 }
36
37 $url .= $this->getPathQuery();
38
39 if($this->fragment <> '')
40 {
41 $url .= "#".$this->fragment;
42 }
43
44 return $url;
45 }
46
47 public function getASCIIHost()
48 {
49 if($this->host <> '')
50 {
51 $asciiHost = \CBXPunycode::ToASCII($this->host, $a);
52 if($asciiHost)
53 {
54 return $asciiHost;
55 }
56 }
57
58 return $this->host;
59 }
60
61}