diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 793d0d54bc..2dcc2adecb 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -212,7 +212,7 @@ function gen_forum_rules($mode, &$forum_id) foreach ($rules as $rule) { $template->assign_block_vars('rules', array( - 'RULE' => ($auth->acl_gets('f_' . $rule, 'm_', 'a_', intval($forum_id))) ? $user->lang['RULES_' . strtoupper($rule) . '_CAN'] : $user->lang['RULES_' . strtoupper($rule) . '_CANNOT']) + 'RULE' => ($auth->acl_get('f_' . $rule, intval($forum_id))) ? $user->lang['RULES_' . strtoupper($rule) . '_CAN'] : $user->lang['RULES_' . strtoupper($rule) . '_CANNOT']) ); } @@ -275,7 +275,7 @@ function make_jumpbox($action, $forum_id = false, $enable_select_all = false) continue; } - if (!$auth->acl_gets('f_list', 'm_', 'a_', intval($row['forum_id']))) + if (!$auth->acl_get('f_list', $row['forum_id'])) { // if the user does not have permissions to list this forum skip continue; @@ -320,7 +320,7 @@ function make_jumpbox($action, $forum_id = false, $enable_select_all = false) if (!$right) { - $boxstring .= ''; + $boxstring .= ''; } $boxstring .= ''; @@ -735,12 +735,13 @@ function obtain_word_list(&$censors) { do { - $censors['match'][] = '#\b(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')\b#i'; + $censors['match'][] = '#(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')#i'; $censors['replace'][] = $row['replacement']; } while ($row = $db->sql_fetchrow($result)); } $db->sql_freeresult($result); + $cache->put('word_censors', $censors); } @@ -821,7 +822,7 @@ function generate_board_url() { global $config; - return (($config['cookie_secure']) ? 'https://' : 'http://') . trim($config['server_name']) . (($config['server_port'] <> 80) ? ':' . trim($config['server_port']) . '/' : '/') . preg_replace('/^\/?(.*?)\/?$/', '\1', trim($config['script_path'])); + return (($config['cookie_secure']) ? 'https://' : 'http://') . preg_replace('#^/?(.*?)/?$#', '\1', trim($config['server_name'])) . (($config['server_port'] <> 80) ? ':' . trim($config['server_port']) . '/' : '/') . preg_replace('#^/?(.*?)/?$#', '\1', trim($config['script_path'])); } // Redirects the user to another page then exits the script nicely @@ -833,71 +834,28 @@ function redirect($url) { $db->sql_close(); } + if (isset($cache)) { $cache->unload(); } - $server_protocol = ($config['cookie_secure']) ? 'https://' : 'http://'; - $server_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($config['server_name'])); - $server_port = ($config['server_port'] <> 80) ? ':' . trim($config['server_port']) . '/' : '/'; - $script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($config['script_path'])); - $url = (($script_name == '') ? '' : '/') . preg_replace('/^\/?(.*?)\/?$/', '\1', trim($url)); + $url = generate_board_url() . preg_replace('#^/?(.*?)/?$#', '/\1', trim($url)); // Redirect via an HTML form for PITA webservers - if (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) + if (@preg_match('#Microsoft|WebSTAR|Xitami#', getenv('SERVER_SOFTWARE'))) { - header('Refresh: 0; URL=' . $server_protocol . $server_name . $server_port . $script_name . $url); - echo '