diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2005-01-15 18:49:54 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2005-01-15 18:49:54 +0000 |
commit | f68771d64ce689fe4e9300c88d5d53b0c685c6ef (patch) | |
tree | 6e4c441547692d13c8da09ee1ac0dc8ef2770b3d | |
parent | 2e4ae506a60fb062a5f93e71aa5bf3e0e8b6635e (diff) | |
download | forums-f68771d64ce689fe4e9300c88d5d53b0c685c6ef.tar forums-f68771d64ce689fe4e9300c88d5d53b0c685c6ef.tar.gz forums-f68771d64ce689fe4e9300c88d5d53b0c685c6ef.tar.bz2 forums-f68771d64ce689fe4e9300c88d5d53b0c685c6ef.tar.xz forums-f68771d64ce689fe4e9300c88d5d53b0c685c6ef.zip |
- bugfixes
- do not hardcode url bbcode tag (please change the bitfield accordingly - see schema file!)
git-svn-id: file:///svn/phpbb/trunk@5063 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/common.php | 1 | ||||
-rw-r--r-- | phpBB/includes/bbcode.php | 1 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 10 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_user.php | 5 | ||||
-rw-r--r-- | phpBB/includes/message_parser.php | 6 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm.php | 15 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_options.php | 2 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_zebra.php | 3 | ||||
-rw-r--r-- | phpBB/install/schemas/schema_data.sql | 2 | ||||
-rw-r--r-- | phpBB/language/en/ucp.php | 2 | ||||
-rw-r--r-- | phpBB/posting.php | 23 |
12 files changed, 50 insertions, 22 deletions
diff --git a/phpBB/common.php b/phpBB/common.php index 441bd06cfa..41c31e75b1 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -263,6 +263,7 @@ if ($config = $cache->get('config')) { $config[$row['config_name']] = $row['config_value']; } + $db->sql_freeresult($result); } else { diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 2ed8b00e0e..40d477cfec 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -342,7 +342,6 @@ class bbcode 'i_close' => '</span>', 'u_open' => '<span style="text-decoration: underline">', 'u_close' => '</span>', - 'url' => '<a href="$1" target="_blank">$2</a>', 'img' => '<img src="$1" border="0" />', 'size' => '<span style="font-size: $1px; line-height: normal">$2</span>', 'color' => '<span style="color: $1">$2</span>', diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index e6f6abac48..e75b01714c 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -640,11 +640,11 @@ function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false) switch (SQL_LAYER) { case 'mysql': - case 'mysql4': $sql .= (($sql != '') ? ', ' : '') . '(' . $user->data['user_id'] . ", $forum_id, $current_time)"; $sql = 'VALUES ' . $sql; break; + case 'mysql4': case 'mssql': case 'sqlite': $sql .= (($sql != '') ? ' UNION ALL ' : '') . ' SELECT ' . $user->data['user_id'] . ", $forum_id, $current_time"; @@ -1017,7 +1017,10 @@ function redirect($url) $url = str_replace('&', '&', $url); // Local redirect? If not, prepend the boards url - $url = (strpos($url, '://') === false) ? (generate_board_url() . preg_replace('#^/?(.*?)/?$#', '/\1', trim($url))) : $url; + if (strpos($url, '://') === false && strpos($url, '/') !== 0) + { + $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'))) @@ -1715,7 +1718,7 @@ function page_header($page_title = '') 'L_INDEX' => $user->lang['FORUM_INDEX'], 'L_ONLINE_EXPLAIN' => $l_online_time, - 'U_PRIVATEMSGS' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=view_messages", + 'U_PRIVATEMSGS' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=" . (($user->data['user_new_privmsg'] || $l_privmsgs_text_unread) ? 'unread' : 'view_messages'), 'U_RETURN_INBOX' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox", 'U_POPUP_PM' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=popup", 'U_MEMBERLIST' => "{$phpbb_root_path}memberlist.$phpEx$SID", @@ -1751,6 +1754,7 @@ function page_header($page_title = '') 'T_THEME_PATH' => "{$phpbb_root_path}styles/" . $user->theme['primary']['theme_path'] . '/theme', 'T_TEMPLATE_PATH' => "{$phpbb_root_path}styles/" . $user->theme['primary']['template_path'] . '/template', 'T_IMAGESET_PATH' => "{$phpbb_root_path}styles/" . $user->theme['primary']['imageset_path'] . '/imageset', + 'T_IMAGESET_LANG_PATH' => "{$phpbb_root_path}styles/" . $user->theme['primary']['imageset_path'] . '/imageset/' . $user->data['user_lang'], 'T_STYLESHEET_LINK' => (!$user->theme['primary']['theme_storedb']) ? "{$phpbb_root_path}styles/" . $user->theme['primary']['theme_path'] . '/theme/stylesheet.css' : "{$phpbb_root_path}style.$phpEx?sid=$user->session_id&id=" . $user->theme['primary']['theme_id'], 'T_STYLESHEET_NAME' => $user->theme['primary']['theme_name'], 'T_THEME_DATA' => (!$user->theme['primary']['theme_storedb']) ? '' : $user->theme['primary']['theme_data']) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 06734c65d7..7aba451285 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -542,7 +542,7 @@ function decode_message(&$message, $bbcode_uid = '') '#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#', '#<!\-\- m \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- m \-\->#', '#<!\-\- w \-\-><a href="http:\/\/(.*?)" target="_blank">.*?</a><!\-\- w \-\->#', - '#<!\-\- l \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- l \-\->#', + '#<!\-\- l \-\-><a href="(.*?)">.*?</a><!\-\- l \-\->#', '#<!\-\- s(.*?) \-\-><img src="\{SMILE_PATH\}\/.*? \/><!\-\- s\1 \-\->#', '#<!\-\- h \-\-><(.*?)><!\-\- h \-\->#', '#<.*?>#s' diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 0f5dc852c9..2ff884f69b 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -480,10 +480,10 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas switch (SQL_LAYER) { case 'mysql': - case 'mysql4': $sql .= (($sql != '') ? ', ' : '') . "($ban_entry, $current_time, $ban_end, $ban_exclude, '$ban_reason')"; break; + case 'mysql4': case 'mssql': case 'sqlite': $sql .= (($sql != '') ? ' UNION ALL ' : '') . " SELECT $ban_entry, $current_time, $ban_end, $ban_exclude, '$ban_reason'"; @@ -1285,14 +1285,13 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, switch (SQL_LAYER) { case 'mysql': - case 'mysql4': $sql = 'INSERT INTO ' . USER_GROUP_TABLE . " (user_id, group_id, group_leader) VALUES " . implode(', ', preg_replace('#^([0-9]+)$#', "(\\1, $group_id, $leader)", $add_id_ary)); $db->sql_query($sql); break; + case 'mysql4': case 'mssql': - case 'mssql-odbc': case 'sqlite': $sql = 'INSERT INTO ' . USER_GROUP_TABLE . " (user_id, group_id, group_leader) " . implode(' UNION ALL ', preg_replace('#^([0-9]+)$#', "(\\1, $group_id, $leader)", $add_id_ary)); diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index aaa6c18268..bc8ce4033a 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -179,7 +179,7 @@ class bbcode_firstpass extends bbcode '#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#', '#<!\-\- m \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- m \-\->#', '#<!\-\- w \-\-><a href="http:\/\/(.*?)" target="_blank">.*?</a><!\-\- w \-\->#', - '#<!\-\- l \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- l \-\->#', + '#<!\-\- l \-\-><a href="(.*?)">.*?</a><!\-\- l \-\->#', '#<!\-\- s(.*?) \-\-><img src="\{SMILE_PATH\}\/.*? \/><!\-\- s\1 \-\->#', '#<!\-\- h \-\-><(.*?)><!\-\- h \-\->#', ); @@ -821,7 +821,7 @@ class parse_message extends bbcode_firstpass // relative urls for this board $match[] = '#(^|[\n ]|\()(' . preg_quote($server_protocol . trim($server_name) . $server_port . preg_replace('/^\/?(.*?)(\/)?$/', '$1', trim($script_path)), '#') . ')/(.*?([^ \t\n\r<"\'\)]*)?)#i'; - $replace[] = '$1<!-- l --><a href="$2/$3" target="_blank">$3</a><!-- l -->'; + $replace[] = '$1<!-- l --><a href="$2/$3">$3</a><!-- l -->'; // matches a xxxx://aaaaa.bbb.cccc. ... $match[] = '#(^|[\n ]|\()([\w]+?://.*?([^ \t\n\r<"\'\)]*)?)#ie'; @@ -1310,12 +1310,12 @@ class fulltext_search switch (SQL_LAYER) { case 'mysql': - case 'mysql4': $sql = 'INSERT INTO ' . SEARCH_WORD_TABLE . ' (word_text) VALUES ' . implode(', ', preg_replace('#^(.*)$#', '(\'$1\')', $new_words)); $db->sql_query($sql); break; + case 'mysql4': case 'mssql': case 'sqlite': $sql = 'INSERT INTO ' . SEARCH_WORD_TABLE . ' (word_text) ' . implode(' UNION ALL ', preg_replace('#^(.*)$#', "SELECT '\$1'", $new_words)); diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index ab2b7b9b50..fdb6396133 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -129,6 +129,13 @@ class ucp_pm extends module break; case 'options': + $sql = 'SELECT group_message_limit + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . $user->data['group_id']; + $result = $db->sql_query($sql); + $user->data['group_message_limit'] = (int) $db->sql_fetchfield('group_message_limit', 0, $result); + $db->sql_freeresult($result); + get_folder($user->data['user_id'], $folder); include($phpbb_root_path . 'includes/ucp/ucp_pm_options.'.$phpEx); @@ -145,6 +152,14 @@ class ucp_pm extends module case 'unread': case 'view_messages': + + $sql = 'SELECT group_message_limit + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . $user->data['group_id']; + $result = $db->sql_query($sql); + $user->data['group_message_limit'] = (int) $db->sql_fetchfield('group_message_limit', 0, $result); + $db->sql_freeresult($result); + if ($folder_specified) { $folder_id = $folder_specified; diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php index 53946e3c00..a07b8e3aee 100644 --- a/phpBB/includes/ucp/ucp_pm_options.php +++ b/phpBB/includes/ucp/ucp_pm_options.php @@ -409,7 +409,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit $rule_lang = $action_lang = $check_lang = array(); // Build all three language arrays - preg_replace('#(?:)((RULE|ACTION|CHECK)_([A-Z0-9_]+))(?:)#e', "\${strtolower('\\2') . '_lang'}[constant('\\1')] = \$user->lang['PM_\\2']['\\3']", implode(':', array_keys(get_defined_constants()))); + preg_replace('#^((RULE|ACTION|CHECK)_([A-Z0-9_]+))$#e', "\${strtolower('\\2') . '_lang'}[constant('\\1')] = \$user->lang['PM_\\2']['\\3']", array_keys(get_defined_constants())); /* Rule Ordering: diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index ca07234fc7..cdc5f9ca4b 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -114,14 +114,13 @@ class ucp_zebra extends module switch (SQL_LAYER) { case 'mysql': - case 'mysql4': $sql = 'INSERT INTO ' . ZEBRA_TABLE . " (user_id, zebra_id, $sql_mode) VALUES " . implode(', ', preg_replace('#^([0-9]+)$#', '(' . $user->data['user_id'] . ", \\1, 1)", $user_id_ary)); $db->sql_query($sql); break; + case 'mysql4': case 'mssql': - case 'mssql-odbc': case 'sqlite': $sql = 'INSERT INTO ' . ZEBRA_TABLE . " (user_id, zebra_id, $sql_mode) " . implode(' UNION ALL ', preg_replace('#^([0-9]+)$#', '(' . $user->data['user_id'] . ", \\1, 1)", $user_id_ary)); diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 85b1f5b8b6..695ff10cd5 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -328,7 +328,7 @@ INSERT INTO phpbb_styles_imageset (imageset_id, imageset_name, imageset_copyrigh # MSSQL IDENTITY phpbb_styles_template ON # # -- phpbb_styles_template -INSERT INTO phpbb_styles_template (template_id, template_name, template_copyright, template_path, bbcode_bitfield) VALUES (1, 'subSilver', '© phpBB Group', 'subSilver', 6913); +INSERT INTO phpbb_styles_template (template_id, template_name, template_copyright, template_path, bbcode_bitfield) VALUES (1, 'subSilver', '© phpBB Group', 'subSilver', 6921); # MSSQL IDENTITY phpbb_styles_template OFF # diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index f6638d1d43..cb0c4d0452 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -123,7 +123,7 @@ $lang += array( 'DRAFTS_EXPLAIN' => 'Here you can view, edit and delete your saved drafts.', 'DRAFT_UPDATED' => 'Draft successfully updated.', - 'EDIT_DRAFT_EXPLAIN' => 'Here you are able to edit your draft.', + 'EDIT_DRAFT_EXPLAIN' => 'Here you are able to edit your draft. Drafts do not contain attachment and poll informations.', 'EMAIL_INVALID_EMAIL' => 'The email address you entered is invalid.', 'EMAIL_REMIND' => 'This must be the email address you supplied when registering.', 'EMAIL_PM' => 'Email PM', diff --git a/phpBB/posting.php b/phpBB/posting.php index a7d6d6f3fc..3e58394958 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -136,6 +136,12 @@ if ($sql) $topic_id = (int) $topic_id; $post_id = (int) $post_id; + // Global Topic? - Adjust forum id + if (!$forum_id && $topic_type == POST_GLOBAL) + { + $forum_id = request_var('f', 0); + } + $post_edit_locked = (isset($post_edit_locked)) ? (int) $post_edit_locked : 0; $user->setup(array('posting', 'mcp', 'viewtopic'), $forum_style); @@ -474,8 +480,8 @@ if ($draft_id && $user->data['user_id'] != ANONYMOUS && $auth->acl_get('u_savedr if ($row = $db->sql_fetchrow($result)) { - $_REQUEST['subject'] = $row['draft_subject']; - $_POST['message'] = $row['draft_message']; + $_REQUEST['subject'] = strtr($row['draft_subject'], array_flip(get_html_translation_table(HTML_ENTITIES))); + $_POST['message'] = strtr($row['draft_message'], array_flip(get_html_translation_table(HTML_ENTITIES))); $refresh = true; $template->assign_var('S_DRAFT_LOADED', true); } @@ -1452,17 +1458,22 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u } $sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id'])) ? ', user_posts = user_posts + 1' : ''); - if (!$auth->acl_get('f_moderate', $data['forum_id'])) + + if ($topic_type == POST_GLOBAL) { - $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts + 1'; + if (!$auth->acl_get('f_moderate', $data['forum_id'])) + { + $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts + 1'; + } + $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_real = forum_topics_real + 1' . ((!$auth->acl_get('f_moderate', $data['forum_id'])) ? ', forum_topics = forum_topics + 1' : ''); } - $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_real = forum_topics_real + 1' . ((!$auth->acl_get('f_moderate', $data['forum_id'])) ? ', forum_topics = forum_topics + 1' : ''); break; case 'reply': $sql_data[TOPICS_TABLE]['stat'][] = 'topic_replies_real = topic_replies_real + 1, topic_bumped = 0, topic_bumper = 0' . ((!$auth->acl_get('f_moderate', $data['forum_id'])) ? ', topic_replies = topic_replies + 1' : ''); $sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id'])) ? ', user_posts = user_posts + 1' : ''); - if (!$auth->acl_get('f_moderate', $data['forum_id'])) + + if (!$auth->acl_get('f_moderate', $data['forum_id']) && $topic_type != POST_GLOBAL) { $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts + 1'; } |