Merge branch 'master' of github.com:gnuboard/gnuboard5

This commit is contained in:
thisgun
2023-03-23 12:25:33 +09:00

View File

@ -298,15 +298,18 @@ function seo_title_update($db_table, $pk_id, $type='bbs'){
}
}
function get_nginx_conf_rules($return_string=false){
function get_nginx_conf_rules($return_string = false)
{
$get_path_url = parse_url(G5_URL);
$base_path = isset($get_path_url['path']) ? $get_path_url['path'] . '/' : '/';
$rules = array();
$rules[] = '#### ' . G5_VERSION . ' nginx rules BEGIN #####';
if ($add_rules = run_replace('add_nginx_conf_pre_rules', '', $get_path_url, $base_path, $return_string)) {
$rules[] = $add_rules;
}
$rules[] = 'if (!-e $request_filename) {';
if ($add_rules = run_replace('add_nginx_conf_rules', '', $get_path_url, $base_path, $return_string)) {
@ -326,18 +329,21 @@ function get_nginx_conf_rules($return_string=false){
return $return_string ? implode("\n", $rules) : $rules;
}
function get_mod_rewrite_rules($return_string=false){
function get_mod_rewrite_rules($return_string = false)
{
$get_path_url = parse_url(G5_URL);
$base_path = isset($get_path_url['path']) ? $get_path_url['path'] . '/' : '/';
$rules = array();
$rules[] = '#### ' . G5_VERSION . ' rewrite BEGIN #####';
$rules[] = '<IfModule mod_rewrite.c>';
$rules[] = 'RewriteEngine On';
$rules[] = 'RewriteBase ' . $base_path;
if ($add_rules = run_replace('add_mod_rewrite_pre_rules', '', $get_path_url, $base_path, $return_string)) {
$rules[] = $add_rules;
}
$rules[] = 'RewriteCond %{REQUEST_FILENAME} -f [OR]';
$rules[] = 'RewriteCond %{REQUEST_FILENAME} -d';
$rules[] = 'RewriteRule ^ - [L]';