summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2010-12-18 04:12:37 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2010-12-18 04:12:37 +1100
commit323fe4e61c722d2c6954f3b21ecd83ba8a22bda9 (patch)
tree08ee83e40b85d86bc21bfb9736299fe9129df391 /inc
parent53b32ce8a5460f6d75685b38b62d84a80fdb7f8a (diff)
URL_MATCH when ROOT is a full URL
Diffstat (limited to 'inc')
-rw-r--r--inc/config.php23
1 files changed, 13 insertions, 10 deletions
diff --git a/inc/config.php b/inc/config.php
index 4f5bc92b..24d522c7 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -220,16 +220,19 @@
define('ALWAYS_NOKO', false, true);
define('URL_MATCH', '/^' .
- (@$_SERVER['HTTPS']?'https':'http').':\/\/'.$_SERVER['HTTP_HOST'] . preg_quote(ROOT, '/') .
- '(' .
- str_replace('%s', '\w{1,8}', preg_quote(BOARD_PATH, '/')) .
- '|' .
- str_replace('%s', '\w{1,8}', preg_quote(BOARD_PATH, '/')) .
- preg_quote(FILE_INDEX, '/') .
- '|' .
- str_replace('%s', '\w{1,8}', preg_quote(BOARD_PATH, '/')) .
- str_replace('%d', '\d+', preg_quote(FILE_PAGE, '/')) .
- ')$/', true);
+ (preg_match(URL_REGEX, ROOT) ? '' :
+ (@$_SERVER['HTTPS']?'https':'http') .
+ ':\/\/'.$_SERVER['HTTP_HOST']) .
+ preg_quote(ROOT, '/') .
+ '(' .
+ str_replace('%s', '\w{1,8}', preg_quote(BOARD_PATH, '/')) .
+ '|' .
+ str_replace('%s', '\w{1,8}', preg_quote(BOARD_PATH, '/')) .
+ preg_quote(FILE_INDEX, '/') .
+ '|' .
+ str_replace('%s', '\w{1,8}', preg_quote(BOARD_PATH, '/')) .
+ str_replace('%d', '\d+', preg_quote(FILE_PAGE, '/')) .
+ ')$/i', true);
if(ROOT_FILE) {
chdir(ROOT_FILE);