mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-05 15:16:16 +02:00
- 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
This commit is contained in:
parent
2e4ae506a6
commit
f68771d64c
@ -263,6 +263,7 @@ if ($config = $cache->get('config'))
|
||||
{
|
||||
$config[$row['config_name']] = $row['config_value'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -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>',
|
||||
|
@ -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'])
|
||||
|
@ -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'
|
||||
|
@ -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));
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
|
@ -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:
|
||||
|
@ -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));
|
||||
|
@ -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 #
|
||||
|
||||
|
@ -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',
|
||||
|
@ -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';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user