Compare commits

..

2 Commits

Author SHA1 Message Date
29371d550e
fix: blog url
All checks were successful
continuous-integration/drone/push Build is passing
2022-09-20 15:30:23 +08:00
a932b51629
fix: protocol 2022-09-20 15:08:57 +08:00
2 changed files with 4 additions and 4 deletions

View File

@ -54,7 +54,7 @@ class HTML {
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 = UOJConfig::$data['web']['main']['protocol'].'://'.UOJConfig::$data['web']['main']['host'].$port.'/blog/'.blog_name_encode($username);
$url = '/blog/'.blog_name_encode($username);
break;
}
$url .= $uri;
@ -70,7 +70,7 @@ class HTML {
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 = UOJConfig::$data['web']['main']['protocol'].'://'.UOJConfig::$data['web']['main']['host'].$port.'/blogs';
$url = '/blogs';
break;
}
return HTML::escape(rtrim($url, '/'));
@ -97,7 +97,7 @@ class HTML {
// }
if ($param) {
$url .= $path.'?'.HTML::query_string_encode($param);
} else {
} else if ($url != '/') {
$url .= rtrim($path, '/');
}
return HTML::escape($url);

View File

@ -87,7 +87,7 @@ dockerInitProgress() {
chown -R www-data:www-data /var/uoj_data
#Replace password placeholders
sed -i -e "s/salt0/$_salt0_/g" -e "s/salt1/$_salt1_/g" -e "s/salt2/$_salt2_/g" -e "s/salt3/$_salt3_/g" -e "s/_judger_socket_password_/$_judger_socket_password_/g" /var/www/uoj/app/.config.php
sed -i -e "s/'protocol' => 'http'/'protocol' => '$_uoj_protocol_',/g" /var/www/uoj/app/.config.php
sed -i -e "s/'protocol' => 'http'/'protocol' => '$_uoj_protocol_'/g" /var/www/uoj/app/.config.php
#Start services
service ntp restart
service apache2 restart