1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-28 01:10:51 +01:00

Don't overwrite configs when loading

This commit is contained in:
Savetheinternet 2011-02-16 16:24:23 +11:00
parent defe48be8e
commit f8e7c0ceb9

View File

@ -9,32 +9,39 @@
require 'instance-config.php'; require 'instance-config.php';
} }
$config['post_url'] = $config['root'] . $config['file_post']; if(!isset($config['post_url']))
$config['post_url'] = $config['root'] . $config['file_post'];
$config['url_match'] = '/^' . if(!isset($config['url_match']))
(preg_match($config['url_regex'], $config['root']) ? '' : $config['url_match'] = '/^' .
(@$_SERVER['HTTPS']?'https':'http') . (preg_match($config['url_regex'], $config['root']) ? '' :
':\/\/'.$_SERVER['HTTP_HOST']) . (@$_SERVER['HTTPS']?'https':'http') .
preg_quote($config['root'], '/') . ':\/\/'.$_SERVER['HTTP_HOST']) .
'(' . preg_quote($config['root'], '/') .
str_replace('%s', '\w{1,8}', preg_quote($config['board_path'], '/')) . '(' .
'|' . str_replace('%s', '\w{1,8}', preg_quote($config['board_path'], '/')) .
str_replace('%s', '\w{1,8}', preg_quote($config['board_path'], '/')) . '|' .
preg_quote($config['file_index'], '/') . str_replace('%s', '\w{1,8}', preg_quote($config['board_path'], '/')) .
'|' . preg_quote($config['file_index'], '/') .
str_replace('%s', '\w{1,8}', preg_quote($config['board_path'], '/')) . '|' .
str_replace('%d', '\d+', preg_quote($config['file_page'], '/')) . str_replace('%s', '\w{1,8}', preg_quote($config['board_path'], '/')) .
'|' . str_replace('%d', '\d+', preg_quote($config['file_page'], '/')) .
preg_quote($config['file_mod'], '/') . '|' .
'\?\/.+' . preg_quote($config['file_mod'], '/') .
')$/i'; '\?\/.+' .
')$/i';
$config['dir']['static'] = $config['root'] . 'static/'; if(!isset($config['dir']['static']))
$config['dir']['static'] = $config['root'] . 'static/';
$config['image_sticky'] = $config['dir']['static'] . 'sticky.gif'; if(!isset($config['image_sticky']))
$config['image_locked'] = $config['dir']['static'] . 'locked.gif'; $config['image_sticky'] = $config['dir']['static'] . 'sticky.gif';
$config['image_deleted'] = $config['dir']['static'] . 'deleted.png'; if(!isset($config['image_locked']))
$config['image_zip'] = $config['dir']['static'] . 'zip.png'; $config['image_locked'] = $config['dir']['static'] . 'locked.gif';
if(!isset($config['image_deleted']))
$config['image_deleted'] = $config['dir']['static'] . 'deleted.png';
if(!isset($config['image_zip']))
$config['image_zip'] = $config['dir']['static'] . 'zip.png';
} }
function sprintf3($str, $vars, $delim = '%') { function sprintf3($str, $vars, $delim = '%') {