mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-12 22:18:41 +00:00
This commit is contained in:
parent
08624f88e0
commit
387fdf968b
@ -53,8 +53,7 @@ class HTML {
|
||||
$url = UOJConfig::$data['web']['blog']['protocol'].'://'.UOJConfig::$data['web']['blog']['host'].$port.'/'.blog_name_encode($username);
|
||||
break;
|
||||
case 3:
|
||||
$port = ((UOJConfig::$data['web']['main']['protocol'] === "http" && UOJConfig::$data['web']['main']['port'] == 80) || (UOJConfig::$data['web']['main']['protocol'] === "https" && UOJConfig::$data['web']['main']['port'] == 443)) ? '' : (':'.UOJConfig::$data['web']['main']['port']);
|
||||
$url = '/blog/'.blog_name_encode($username);
|
||||
$url = HTML::url('/blog/'.blog_name_encode($username));
|
||||
break;
|
||||
}
|
||||
$url .= $uri;
|
||||
@ -69,8 +68,7 @@ class HTML {
|
||||
$url = UOJConfig::$data['web']['blog']['protocol'].'://'.UOJConfig::$data['web']['blog']['host'].$port;
|
||||
break;
|
||||
case 3:
|
||||
$port = ((UOJConfig::$data['web']['main']['protocol'] === "http" && UOJConfig::$data['web']['main']['port'] == 80) || (UOJConfig::$data['web']['main']['protocol'] === "https" && UOJConfig::$data['web']['main']['port'] == 443)) ? '' : (':'.UOJConfig::$data['web']['main']['port']);
|
||||
$url = '/blogs';
|
||||
$url = HTML::url('/blogs');
|
||||
break;
|
||||
}
|
||||
return HTML::escape(rtrim($url, '/'));
|
||||
@ -90,17 +88,11 @@ class HTML {
|
||||
$param = array_merge($param, $config['params']);
|
||||
}
|
||||
|
||||
// $url = UOJConfig::$data['web'][$config['location']]['protocol'].'://'.UOJConfig::$data['web'][$config['location']]['host'];
|
||||
// if ((UOJConfig::$data['web'][$config['location']]['protocol'] === "http" && UOJConfig::$data['web'][$config['location']]['port'] == 80) || (UOJConfig::$data['web'][$config['location']]['protocol'] === "https" && UOJConfig::$data['web'][$config['location']]['port'] == 443)) {
|
||||
// } else {
|
||||
// $url .= ':'.UOJConfig::$data['web'][$config['location']]['port'];
|
||||
// }
|
||||
$url = '//'.UOJConfig::$data['web'][$config['location']]['host'];
|
||||
if ($param) {
|
||||
$url .= $path.'?'.HTML::query_string_encode($param);
|
||||
} elseif ($path != '/') {
|
||||
$url .= rtrim($path, '/');
|
||||
} else {
|
||||
$url = $path;
|
||||
$url .= rtrim($path, '/');
|
||||
}
|
||||
return HTML::escape($url);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user