Allowed change of root directory for systems where it is not the current directory.
This commit is contained in:
parent
f6abfa61c6
commit
247772323e
@ -90,6 +90,11 @@
|
|||||||
// The root directory, including the trailing slash, for Tinyboard.
|
// The root directory, including the trailing slash, for Tinyboard.
|
||||||
// examples: '/', '/board/', '/chan/'
|
// examples: '/', '/board/', '/chan/'
|
||||||
define('ROOT', '/', true);
|
define('ROOT', '/', true);
|
||||||
|
|
||||||
|
// If for some reason the folders and static HTML index files aren't in the current working direcotry,
|
||||||
|
// enter the directory path here. Otherwise, keep it false.
|
||||||
|
define('ROOT_FILE', false);
|
||||||
|
|
||||||
define('POST_URL', ROOT . 'post.php', true);
|
define('POST_URL', ROOT . 'post.php', true);
|
||||||
define('FILE_INDEX', 'index.html', true);
|
define('FILE_INDEX', 'index.html', true);
|
||||||
define('FILE_PAGE', '%d.html', true);
|
define('FILE_PAGE', '%d.html', true);
|
||||||
@ -110,6 +115,9 @@
|
|||||||
|
|
||||||
define('URL_MATCH', '/^' . (@$_SERVER['HTTPS']?'https':'http').':\/\/'.$_SERVER['HTTP_HOST'] . '(' . preg_quote(ROOT, '/') . '|' . preg_quote(ROOT, '/') . '' . preg_quote(FILE_INDEX, '/') . '|' . preg_quote(ROOT, '/') . '' . str_replace('%d', '\d+', preg_quote(FILE_PAGE, '/')) . ')$/', true);
|
define('URL_MATCH', '/^' . (@$_SERVER['HTTPS']?'https':'http').':\/\/'.$_SERVER['HTTP_HOST'] . '(' . preg_quote(ROOT, '/') . '|' . preg_quote(ROOT, '/') . '' . preg_quote(FILE_INDEX, '/') . '|' . preg_quote(ROOT, '/') . '' . str_replace('%d', '\d+', preg_quote(FILE_PAGE, '/')) . ')$/', true);
|
||||||
|
|
||||||
|
if(ROOT_FILE) {
|
||||||
|
chdir(ROOT_FILE);
|
||||||
|
}
|
||||||
if(!defined('IS_INSTALLATION')) {
|
if(!defined('IS_INSTALLATION')) {
|
||||||
if(!file_exists(DIR_IMG)) @mkdir(DIR_IMG) or error("Couldn't create " . DIR_IMG . ". Install manually.", true);
|
if(!file_exists(DIR_IMG)) @mkdir(DIR_IMG) or error("Couldn't create " . DIR_IMG . ". Install manually.", true);
|
||||||
if(!file_exists(DIR_THUMB)) @mkdir(DIR_THUMB) or error("Couldn't create " . DIR_IMG . ". Install manually.", true);
|
if(!file_exists(DIR_THUMB)) @mkdir(DIR_THUMB) or error("Couldn't create " . DIR_IMG . ". Install manually.", true);
|
||||||
|
1
post.php
1
post.php
@ -123,6 +123,7 @@
|
|||||||
if($post['zip']) {
|
if($post['zip']) {
|
||||||
// Validate ZIP file
|
// Validate ZIP file
|
||||||
if(is_resource($zip = zip_open($post['zip'])))
|
if(is_resource($zip = zip_open($post['zip'])))
|
||||||
|
// TODO: Check if it's not empty and has at least one (valid) image
|
||||||
zip_close($zip);
|
zip_close($zip);
|
||||||
else
|
else
|
||||||
error(ERR_INVALIDZIP);
|
error(ERR_INVALIDZIP);
|
||||||
|
Loading…
Reference in New Issue
Block a user