diff --git a/mod.php b/mod.php index 9587c8e1..d5946d0d 100644 --- a/mod.php +++ b/mod.php @@ -1,13 +1,13 @@ ':?/', // redirect to dashboard '/' => 'dashboard', // dashboard '/confirm/(.+)' => 'confirm', // confirm action (if javascript didn't work) @@ -121,14 +121,14 @@ $pages = array( str_replace('%d', '(\d+)', preg_quote($config['file_page'], '!')) => 'view_thread', '/(\%b)/' . preg_quote($config['dir']['res'], '!') . - str_replace(array('%d','%s'), array('(\d+)', '[a-z0-9-]+'), preg_quote($config['file_page50_slug'], '!')) => 'view_thread50', + str_replace([ '%d','%s' ], [ '(\d+)', '[a-z0-9-]+' ], preg_quote($config['file_page50_slug'], '!')) => 'view_thread50', '/(\%b)/' . preg_quote($config['dir']['res'], '!') . - str_replace(array('%d','%s'), array('(\d+)', '[a-z0-9-]+'), preg_quote($config['file_page_slug'], '!')) => 'view_thread', -); + str_replace([ '%d','%s' ], [ '(\d+)', '[a-z0-9-]+' ], preg_quote($config['file_page_slug'], '!')) => 'view_thread', +]; if (!$mod) { - $pages = array('!^(.+)?$!' => 'login'); + $pages = [ '!^(.+)?$!' => 'login' ]; } elseif (isset($_GET['status'], $_GET['r'])) { header('Location: ' . $_GET['r'], true, (int)$_GET['status']); exit; @@ -138,12 +138,11 @@ if (isset($config['mod']['custom_pages'])) { $pages = array_merge($pages, $config['mod']['custom_pages']); } -$new_pages = array(); +$new_pages = []; foreach ($pages as $key => $callback) { if (is_string($callback) && preg_match('/^secure /', $callback)) { $key .= '(/(?P[a-f0-9]{8}))?'; - } - + } $key = str_replace('\%b', '?P' . sprintf(substr($config['board_path'], 0, -1), $config['board_regex']), $key); $new_pages[@$key[0] == '!' ? $key : '!^' . $key . '(?:&[^&=]+=[^&]*)*$!u'] = $callback; } @@ -186,11 +185,11 @@ foreach ($pages as $uri => $handler) { } if ($config['debug']) { - $debug['mod_page'] = array( + $debug['mod_page'] = [ 'req' => $query, 'match' => $uri, 'handler' => $handler, - ); + ]; $debug['time']['parse_mod_req'] = '~' . round((microtime(true) - $parse_start_time) * 1000, 2) . 'ms'; }