Removed unnecessary checks from URL formatter.
This commit is contained in:
parent
473d5f22b5
commit
bec58f589f
1 changed files with 2 additions and 6 deletions
|
@ -136,10 +136,6 @@ function url(string $name, array $variables = []): string {
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
$info = MSZ_URLS[$name];
|
$info = MSZ_URLS[$name];
|
||||||
|
|
||||||
if(!isset($info[0]) || !is_string($info[0]))
|
|
||||||
return '';
|
|
||||||
|
|
||||||
$splitUrl = explode('/', $info[0]);
|
$splitUrl = explode('/', $info[0]);
|
||||||
|
|
||||||
for($i = 0; $i < count($splitUrl); $i++)
|
for($i = 0; $i < count($splitUrl); $i++)
|
||||||
|
@ -147,7 +143,7 @@ function url(string $name, array $variables = []): string {
|
||||||
|
|
||||||
$url = implode('/', $splitUrl);
|
$url = implode('/', $splitUrl);
|
||||||
|
|
||||||
if(!empty($info[1]) && is_array($info[1])) {
|
if(!empty($info[1])) {
|
||||||
$url .= '?';
|
$url .= '?';
|
||||||
|
|
||||||
foreach($info[1] as $key => $value) {
|
foreach($info[1] as $key => $value) {
|
||||||
|
@ -162,7 +158,7 @@ function url(string $name, array $variables = []): string {
|
||||||
$url = trim($url, '?&');
|
$url = trim($url, '?&');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($info[2]) && is_string($info[2]))
|
if(!empty($info[2]))
|
||||||
$url .= rtrim(sprintf('#%s', url_variable($info[2], $variables)), '#');
|
$url .= rtrim(sprintf('#%s', url_variable($info[2], $variables)), '#');
|
||||||
|
|
||||||
return $url;
|
return $url;
|
||||||
|
|
Loading…
Reference in a new issue