diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-07-31 02:08:55 -0400 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-07-31 02:08:55 -0400 |
| commit | 42cba538878cb695ba8b3093f72bc66ccd2fa074 (patch) | |
| tree | 5e0f74d1b933567dc76810d1f9cfb73ffe8efeda /inc/functions.php | |
| parent | 3bee1ba4fd16263ac4eefdf0bc8c7a3d11d8cccb (diff) | |
Allow Unicode in board URIs.
Diffstat (limited to 'inc/functions.php')
| -rw-r--r-- | inc/functions.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/inc/functions.php b/inc/functions.php index d5692be5..6db21c54 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -98,18 +98,18 @@ function loadConfig() { 'https?:\/\/' . $_SERVER['HTTP_HOST']) . preg_quote($config['root'], '/') . '(' . - str_replace('%s', '\w+', preg_quote($config['board_path'], '/')) . + str_replace('%s', $config['board_regex'], preg_quote($config['board_path'], '/')) . '(' . preg_quote($config['file_index'], '/') . '|' . str_replace('%d', '\d+', preg_quote($config['file_page'])) . ')?' . '|' . - str_replace('%s', '\w+', preg_quote($config['board_path'], '/')) . + str_replace('%s', $config['board_regex'], preg_quote($config['board_path'], '/')) . preg_quote($config['dir']['res'], '/') . str_replace('%d', '\d+', preg_quote($config['file_page'], '/')) . '|' . preg_quote($config['file_mod'], '/') . '\?\/.+' . - ')([#?](.+)?)?$/i'; + ')([#?](.+)?)?$/ui'; } else { // CLI mode $config['referer_match'] = '//'; @@ -1468,7 +1468,7 @@ function markup(&$body, $track_cites = false) { } // Cross-board linking - if (preg_match_all('/(^|\s)>>>\/(\w+?)\/(\d+)?([\s,.)?]|$)/m', $body, $cites, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { + if (preg_match_all('/(^|\s)>>>\/(' . $config['board_regex'] . 'f?)\/(\d+)?([\s,.)?]|$)/um', $body, $cites, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { if (count($cites[0]) > $config['max_cites']) { error($config['error']['toomanycross']); } |
