summaryrefslogtreecommitdiff
path: root/inc/config.php
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-03-14 15:38:28 +1100
committerMichael Save <savetheinternet@tinyboard.org>2012-03-14 15:38:28 +1100
commite09dd8782efae9226c31ab67d61456a5ef0bfe8d (patch)
tree3dc9f502049c4961faa95f8ea8811ca8d9d160d2 /inc/config.php
parentc8d1f1cdd4439933f9bd4a451ec73b26d21b97d8 (diff)
less warnings in CLI mode
Diffstat (limited to 'inc/config.php')
-rw-r--r--inc/config.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/inc/config.php b/inc/config.php
index 8f6fdf0e..f8b31c0d 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -635,7 +635,10 @@
// The root directory, including the trailing slash, for Tinyboard.
// examples: '/', 'http://boards.chan.org/', '/chan/'
- $config['root'] = (str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) == '/' ? '/' : str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) . '/');
+ if(isset($_SERVER['REQUEST_URI']))
+ $config['root'] = (str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) == '/' ? '/' : str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) . '/');
+ else
+ $config['root'] = '/'; // CLI mode
// 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.