mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-20 15:31:42 +02:00
some bugfixes
git-svn-id: file:///svn/phpbb/trunk@6149 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -97,7 +97,7 @@ class acp_attachments
|
||||
'max_attachments_pm' => array('lang' => 'MAX_ATTACHMENTS_PM', 'type' => 'text:3:3', 'explain' => false),
|
||||
'secure_downloads' => array('lang' => 'SECURE_DOWNLOADS', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'secure_allow_deny' => array('lang' => 'SECURE_ALLOW_DENY', 'type' => 'custom', 'method' => 'select_allow_deny', 'explain' => true),
|
||||
'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERER', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERRER', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
|
||||
'legend2' => $l_legend_cat_images,
|
||||
'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
|
@@ -204,7 +204,6 @@ class acp_board
|
||||
'coppa_enable' => array('lang' => 'ENABLE_COPPA', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'coppa_mail' => array('lang' => 'COPPA_MAIL', 'type' => 'textarea:5:40', 'explain' => true),
|
||||
'coppa_fax' => array('lang' => 'COPPA_FAX', 'type' => 'text:25:100', 'explain' => false),
|
||||
'coppa_hide_groups' => array('lang' => 'COPPA_HIDE_GROUPS', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
@@ -108,44 +108,41 @@ class acp_icons
|
||||
ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC');
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
if ($action == 'add')
|
||||
{
|
||||
if ($action == 'add')
|
||||
{
|
||||
unset($_images[$row[$fields . '_url']]);
|
||||
}
|
||||
unset($_images[$row[$fields . '_url']]);
|
||||
}
|
||||
|
||||
if ($row[$fields . '_id'] == $icon_id)
|
||||
if ($row[$fields . '_id'] == $icon_id)
|
||||
{
|
||||
$after = true;
|
||||
$data[$row[$fields . '_url']] = $row;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($action == 'edit' && !$icon_id)
|
||||
{
|
||||
$after = true;
|
||||
$data[$row[$fields . '_url']] = $row;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($action == 'edit' && !$icon_id)
|
||||
{
|
||||
$data[$row[$fields . '_url']] = $row;
|
||||
}
|
||||
|
||||
$selected = '';
|
||||
if (!empty($after))
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
$after = false;
|
||||
}
|
||||
|
||||
$after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url'];
|
||||
$order_list = '<option value="' . ($row[$fields . '_order']) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -> ' . htmlspecialchars($after_txt)) . '</option>' . $order_list;
|
||||
$selected = '';
|
||||
if (!empty($after))
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
$after = false;
|
||||
}
|
||||
|
||||
$after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url'];
|
||||
$order_list = '<option value="' . ($row[$fields . '_order']) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -> ' . htmlspecialchars($after_txt)) . '</option>' . $order_list;
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$order_list = '<option value="1"' . ((!isset($after)) ? ' selected="selected"' : '') . '>' . $user->lang['FIRST'] . '</option>' . $order_list;
|
||||
|
||||
$data = array();
|
||||
if ($action == 'add')
|
||||
{
|
||||
$data = $_images;
|
||||
@@ -231,20 +228,20 @@ class acp_icons
|
||||
}
|
||||
|
||||
$img_sql = array(
|
||||
$fields . '_url' => $image,
|
||||
$fields . '_width' => $image_width[$image],
|
||||
$fields . '_height' => $image_height[$image],
|
||||
'display_on_posting'=> (isset($image_display_on_posting[$image])) ? 1 : 0,
|
||||
$fields . '_url' => $image,
|
||||
$fields . '_width' => $image_width[$image],
|
||||
$fields . '_height' => $image_height[$image],
|
||||
'display_on_posting' => (isset($image_display_on_posting[$image])) ? 1 : 0,
|
||||
);
|
||||
|
||||
if ($mode == 'smilies')
|
||||
{
|
||||
$img_sql = array_merge($img_sql, array(
|
||||
'emotion' => $image_emotion[$image],
|
||||
'code' => $image_code[$image])
|
||||
'emotion' => $image_emotion[$image],
|
||||
'code' => $image_code[$image])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if (!empty($image_order[$image]))
|
||||
{
|
||||
$img_sql = array_merge($img_sql, array(
|
||||
@@ -351,7 +348,10 @@ class acp_icons
|
||||
$cur_img = array();
|
||||
|
||||
$field_sql = ($mode == 'smilies') ? 'code' : 'icons_url';
|
||||
$result = $db->sql_query("SELECT $field_sql FROM $table");
|
||||
|
||||
$sql = "SELECT $field_sql
|
||||
FROM $table";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
@@ -371,8 +371,8 @@ class acp_icons
|
||||
$data = array();
|
||||
if (preg_match_all("#'(.*?)', #", $pak_entry, $data))
|
||||
{
|
||||
if ((sizeof($data[1]) != 3 && $mode == 'icons') ||
|
||||
(sizeof($data[1]) != 5 && $mode == 'smilies'))
|
||||
if ((sizeof($data[1]) != 4 && $mode == 'icons') ||
|
||||
(sizeof($data[1]) != 6 && $mode == 'smilies'))
|
||||
{
|
||||
trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action));
|
||||
}
|
||||
@@ -381,11 +381,12 @@ class acp_icons
|
||||
$img = stripslashes($data[1][0]);
|
||||
$width = stripslashes($data[1][1]);
|
||||
$height = stripslashes($data[1][2]);
|
||||
$display_on_posting = stripslashes($data[1][3]);
|
||||
|
||||
if (isset($data[1][3]) && isset($data[1][4]))
|
||||
if (isset($data[1][4]) && isset($data[1][5]))
|
||||
{
|
||||
$emotion = stripslashes($data[1][3]);
|
||||
$code = stripslashes($data[1][4]);
|
||||
$emotion = stripslashes($data[1][4]);
|
||||
$code = stripslashes($data[1][5]);
|
||||
}
|
||||
|
||||
if ($current == 'replace' &&
|
||||
@@ -394,15 +395,16 @@ class acp_icons
|
||||
{
|
||||
$replace_sql = ($mode == 'smilies') ? $code : $img;
|
||||
$sql = array(
|
||||
$fields . '_url' => $img,
|
||||
$fields . '_height' => (int) $height,
|
||||
$fields . '_width' => (int) $width,
|
||||
$fields . '_url' => $img,
|
||||
$fields . '_height' => (int) $height,
|
||||
$fields . '_width' => (int) $width,
|
||||
'display_on_posting' => (int) $display_on_posting,
|
||||
);
|
||||
|
||||
if ($mode == 'smilies')
|
||||
{
|
||||
$sql = array_merge($sql, array(
|
||||
'emotion' => $emotion
|
||||
'emotion' => $emotion,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -415,17 +417,18 @@ class acp_icons
|
||||
++$order;
|
||||
|
||||
$sql = array(
|
||||
$fields . '_url' => $img,
|
||||
$fields . '_height' => (int) $height,
|
||||
$fields . '_width' => (int) $width,
|
||||
$fields . '_order' => (int) $order,
|
||||
$fields . '_url' => $img,
|
||||
$fields . '_height' => (int) $height,
|
||||
$fields . '_width' => (int) $width,
|
||||
$fields . '_order' => (int) $order,
|
||||
'display_on_posting'=> (int) $display_on_posting,
|
||||
);
|
||||
|
||||
if ($mode == 'smilies')
|
||||
{
|
||||
$sql = array_merge($sql, array(
|
||||
'code' => $code,
|
||||
'emotion' => $emotion
|
||||
'code' => $code,
|
||||
'emotion' => $emotion,
|
||||
));
|
||||
}
|
||||
$db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql));
|
||||
@@ -435,7 +438,7 @@ class acp_icons
|
||||
|
||||
$cache->destroy('icons');
|
||||
$cache->destroy('sql', $table);
|
||||
|
||||
|
||||
trigger_error($user->lang[$lang . '_IMPORT_SUCCESS'] . adm_back_link($this->u_action));
|
||||
}
|
||||
else
|
||||
@@ -476,7 +479,7 @@ class acp_icons
|
||||
);
|
||||
|
||||
return;
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'send':
|
||||
@@ -492,6 +495,7 @@ class acp_icons
|
||||
$pak .= "'" . addslashes($row[$fields . '_url']) . "', ";
|
||||
$pak .= "'" . addslashes($row[$fields . '_width']) . "', ";
|
||||
$pak .= "'" . addslashes($row[$fields . '_height']) . "', ";
|
||||
$pak .= "'" . addslashes($row['display_on_posting']) . "', ";
|
||||
|
||||
if ($mode == 'smilies')
|
||||
{
|
||||
@@ -505,7 +509,7 @@ class acp_icons
|
||||
|
||||
if ($pak != '')
|
||||
{
|
||||
$db->sql_close();
|
||||
garbage_collection();
|
||||
|
||||
header('Pragma: public');
|
||||
|
||||
@@ -519,15 +523,16 @@ class acp_icons
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error($user->lang['NO_' . $fields . '_EXPORT'] . adm_back_link($this->u_action));
|
||||
trigger_error($user->lang['NO_' . strtoupper($fields) . '_EXPORT'] . adm_back_link($this->u_action));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
$db->sql_query("DELETE FROM $table
|
||||
WHERE {$fields}_id = $icon_id");
|
||||
$sql = "DELETE FROM $table
|
||||
WHERE {$fields}_id = $icon_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
|
@@ -70,7 +70,7 @@ class acp_permissions
|
||||
if ($select_all_groups)
|
||||
{
|
||||
// Add default groups to selection
|
||||
$sql_and = ($config['coppa_hide_groups']) ? " AND group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : '';
|
||||
$sql_and = (!$config['coppa_enable']) ? " AND group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : '';
|
||||
|
||||
$sql = 'SELECT group_id
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
|
@@ -1505,6 +1505,7 @@ class acp_users
|
||||
case 'sig':
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
||||
include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
|
||||
$enable_bbcode = ($config['allow_sig_bbcode']) ? request_var('enable_bbcode', $this->optionget($user_row, 'bbcode')) : false;
|
||||
$enable_smilies = ($config['allow_sig_smilies']) ? request_var('enable_smilies', $this->optionget($user_row, 'smilies')) : false;
|
||||
@@ -1576,9 +1577,14 @@ class acp_users
|
||||
'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']),
|
||||
|
||||
'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'],
|
||||
'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'],)
|
||||
'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'],
|
||||
'S_BBCODE_IMG' => ($config['allow_sig_img']) ? true : false,
|
||||
'S_BBCODE_FLASH' => ($config['allow_sig_flash']) ? true : false)
|
||||
);
|
||||
|
||||
// Assigning custom bbcodes
|
||||
display_custom_bbcodes();
|
||||
|
||||
break;
|
||||
|
||||
case 'attach':
|
||||
@@ -1808,7 +1814,7 @@ class acp_users
|
||||
$s_group_options = '';
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if ($config['coppa_hide_groups'] && in_array($row['group_name'], array('INACTIVE_COPPA', 'REGISTERED_COPPA')))
|
||||
if (!$config['coppa_enable'] && in_array($row['group_name'], array('INACTIVE_COPPA', 'REGISTERED_COPPA')))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@@ -1202,15 +1202,12 @@ function redirect($url)
|
||||
{
|
||||
global $db, $cache, $config, $user;
|
||||
|
||||
if (isset($db))
|
||||
if (empty($user->lang))
|
||||
{
|
||||
$db->sql_close();
|
||||
$user->add_lang('common');
|
||||
}
|
||||
|
||||
if (isset($cache))
|
||||
{
|
||||
$cache->unload();
|
||||
}
|
||||
garbage_collection();
|
||||
|
||||
// Make sure no &'s are in, this will break the redirect
|
||||
$url = str_replace('&', '&', $url);
|
||||
@@ -2341,16 +2338,8 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
|
||||
|
||||
case E_USER_ERROR:
|
||||
|
||||
if (isset($db))
|
||||
{
|
||||
$db->sql_close();
|
||||
}
|
||||
garbage_collection();
|
||||
|
||||
if (isset($cache))
|
||||
{
|
||||
$cache->unload();
|
||||
}
|
||||
|
||||
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
|
||||
echo '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">';
|
||||
echo '<head>';
|
||||
@@ -2499,7 +2488,9 @@ function page_header($page_title = '', $display_online_list = true)
|
||||
if (!empty($_REQUEST['f']))
|
||||
{
|
||||
$f = request_var('f', 0);
|
||||
$reading_sql = " AND s.session_page LIKE '%f=$f%'";
|
||||
|
||||
// Do not change this (it is defined as _f_={forum_id}x within session.php)
|
||||
$reading_sql = " AND s.session_page LIKE '%\_f\_={$f}x%'";
|
||||
}
|
||||
|
||||
// Get number of online guests
|
||||
@@ -2727,6 +2718,7 @@ function page_header($page_title = '', $display_online_list = true)
|
||||
'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false,
|
||||
'S_BOARD_DISABLED' => ($config['board_disable'] && !defined('IN_LOGIN') && $auth->acl_gets('a_', 'm_')) ? true : false,
|
||||
'S_REGISTERED_USER' => $user->data['is_registered'],
|
||||
'S_IS_BOT' => $user->data['is_bot'],
|
||||
'S_USER_PM_POPUP' => $user->optionget('popuppm'),
|
||||
'S_USER_LANG' => $user->data['user_lang'],
|
||||
'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'],
|
||||
|
@@ -212,7 +212,7 @@ function group_select_options($group_id, $exclude_ids = false)
|
||||
global $db, $user, $config;
|
||||
|
||||
$exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE group_id NOT IN (' . implode(', ', array_map('intval', $exclude_ids)) . ')' : '';
|
||||
$sql_and = ($config['coppa_hide_groups']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : '';
|
||||
$sql_and = (!$config['coppa_enable']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : '';
|
||||
|
||||
$sql = 'SELECT group_id, group_name, group_type
|
||||
FROM ' . GROUPS_TABLE . "
|
||||
@@ -483,7 +483,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
|
||||
*/
|
||||
function delete_topics($where_type, $where_ids, $auto_sync = true)
|
||||
{
|
||||
global $db;
|
||||
global $db, $config;
|
||||
|
||||
$forum_ids = $topic_ids = array();
|
||||
|
||||
@@ -546,6 +546,8 @@ function delete_topics($where_type, $where_ids, $auto_sync = true)
|
||||
sync('topic_reported', $where_type, $where_ids);
|
||||
}
|
||||
|
||||
set_config('num_topics', $config['num_topics'] - sizeof($return['topics']), true);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -638,6 +640,8 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
|
||||
sync('forum', 'forum_id', $forum_ids, true);
|
||||
}
|
||||
|
||||
set_config('num_posts', $config['num_posts'] - sizeof($post_ids), true);
|
||||
|
||||
return sizeof($post_ids);
|
||||
}
|
||||
|
||||
|
@@ -652,7 +652,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold
|
||||
break;
|
||||
|
||||
default:
|
||||
if ($replies >= $config['hot_threshold'])
|
||||
if ($config['hot_threshold'] && $replies >= $config['hot_threshold'])
|
||||
{
|
||||
$folder = 'folder_hot';
|
||||
$folder_new = 'folder_hot_new';
|
||||
@@ -897,6 +897,39 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_
|
||||
return $return_tpl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign/Build custom bbcodes for display in screens supporting using of bbcodes
|
||||
* The custom bbcodes buttons will be placed within the template block 'custom_codes'
|
||||
*/
|
||||
function display_custom_bbcodes()
|
||||
{
|
||||
global $db, $template;
|
||||
|
||||
// Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing)
|
||||
$num_predefined_bbcodes = 22;
|
||||
|
||||
/*
|
||||
* @todo while adjusting custom bbcodes, think about caching this query as well as correct ordering
|
||||
*/
|
||||
$sql = 'SELECT bbcode_id, bbcode_tag
|
||||
FROM ' . BBCODES_TABLE . '
|
||||
WHERE display_on_posting = 1';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$i = 0;
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$template->assign_block_vars('custom_tags', array(
|
||||
'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
|
||||
'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2),
|
||||
'BBCODE_TAG' => $row['bbcode_tag'])
|
||||
);
|
||||
|
||||
$i++;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display reasons
|
||||
*/
|
||||
|
@@ -118,7 +118,7 @@ class messenger
|
||||
*/
|
||||
function headers($headers)
|
||||
{
|
||||
$this->extra_headers .= trim($headers) . "\n";
|
||||
$this->extra_headers .= trim($headers) . "\r\n";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -339,22 +339,22 @@ class messenger
|
||||
}
|
||||
|
||||
// Build header
|
||||
$headers = 'From: ' . $this->from . "\n";
|
||||
$headers .= ($cc != '') ? "Cc: $cc\n" : '';
|
||||
$headers .= ($bcc != '') ? "Bcc: $bcc\n" : '';
|
||||
$headers .= 'Reply-to: ' . $this->replyto . "\n";
|
||||
$headers .= 'Return-Path: <' . $config['board_email'] . ">\n";
|
||||
$headers .= 'Sender: <' . $config['board_email'] . ">\n";
|
||||
$headers .= "MIME-Version: 1.0\n";
|
||||
$headers .= 'Message-ID: <' . md5(unique_id(time())) . "@" . $config['server_name'] . ">\n";
|
||||
$headers .= 'Date: ' . gmdate('D, d M Y H:i:s T', time()) . "\n";
|
||||
$headers .= "Content-type: text/plain; charset={$this->encoding}\n";
|
||||
$headers .= "Content-transfer-encoding: 8bit\n";
|
||||
$headers .= "X-Priority: {$this->mail_priority}\n";
|
||||
$headers .= 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High')) . "\n";
|
||||
$headers .= "X-Mailer: PhpBB\n";
|
||||
$headers .= "X-MimeOLE: phpBB\n";
|
||||
$headers .= "X-phpBB-Origin: phpbb://" . str_replace(array('http://', 'https://'), array('', ''), generate_board_url()) . "\n";
|
||||
$headers = 'From: ' . $this->from . "\r\n";
|
||||
$headers .= ($cc != '') ? "Cc: $cc\r\n" : '';
|
||||
$headers .= ($bcc != '') ? "Bcc: $bcc\r\n" : '';
|
||||
$headers .= 'Reply-to: ' . $this->replyto . "\r\n";
|
||||
$headers .= 'Return-Path: <' . $config['board_email'] . ">\r\n";
|
||||
$headers .= 'Sender: <' . $config['board_email'] . ">\r\n";
|
||||
$headers .= "MIME-Version: 1.0\r\n";
|
||||
$headers .= 'Message-ID: <' . md5(unique_id(time())) . "@" . $config['server_name'] . ">\r\n";
|
||||
$headers .= 'Date: ' . gmdate('D, d M Y H:i:s T', time()) . "\r\n";
|
||||
$headers .= "Content-type: text/plain; charset={$this->encoding}\r\n";
|
||||
$headers .= "Content-transfer-encoding: 8bit\r\n";
|
||||
$headers .= "X-Priority: {$this->mail_priority}\r\n";
|
||||
$headers .= 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High')) . "\r\n";
|
||||
$headers .= "X-Mailer: PhpBB3\r\n";
|
||||
$headers .= "X-MimeOLE: phpBB3\r\n";
|
||||
$headers .= "X-phpBB-Origin: phpbb://" . str_replace(array('http://', 'https://'), array('', ''), generate_board_url()) . "\r\n";
|
||||
$headers .= ($this->extra_headers != '') ? $this->extra_headers : '';
|
||||
|
||||
// Send message ... removed $this->encode() from subject for time being
|
||||
|
@@ -219,34 +219,6 @@ function user_add($user_row, $cp_data = false)
|
||||
{
|
||||
$cp_data['user_id'] = (int) $user_id;
|
||||
|
||||
switch (SQL_LAYER)
|
||||
{
|
||||
case 'oracle':
|
||||
case 'firebird':
|
||||
case 'postgres':
|
||||
$right_delim = $left_delim = '"';
|
||||
break;
|
||||
|
||||
case 'sqlite':
|
||||
case 'mssql':
|
||||
case 'mssql_odbc':
|
||||
$right_delim = ']';
|
||||
$left_delim = '[';
|
||||
break;
|
||||
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
case 'mysqli':
|
||||
$right_delim = $left_delim = '`';
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ($cp_data as $key => $value)
|
||||
{
|
||||
$cp_data[$right_delim . $key . $left_delim] = $value;
|
||||
unset($cp_data[$key]);
|
||||
}
|
||||
|
||||
if (!class_exists('custom_profile'))
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
|
||||
@@ -375,6 +347,9 @@ function user_delete($mode, $user_id, $post_username = false)
|
||||
|
||||
set_config('num_users', $config['num_users'] - 1, true);
|
||||
|
||||
// Adjust last post info...
|
||||
|
||||
|
||||
$db->sql_transaction('commit');
|
||||
|
||||
return false;
|
||||
@@ -1187,7 +1162,7 @@ function avatar_remote($data, &$error)
|
||||
// Make sure getimagesize works...
|
||||
if (($image_data = @getimagesize($data['remotelink'])) === false)
|
||||
{
|
||||
$error[] = $user->lang['AVATAR_URL_INVALID'];
|
||||
$error[] = $user->lang['UNABLE_GET_IMAGE_SIZE'];
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -803,8 +803,10 @@ class bbcode_firstpass extends bbcode
|
||||
{
|
||||
global $config, $phpEx, $user;
|
||||
|
||||
$check_path = ($user->page['root_script_path'] != '/') ? substr($user->page['root_script_path'], 0, -1) : '/';
|
||||
|
||||
// Is the user trying to link to a php file in this domain and script path?
|
||||
if (strpos($url, ".{$phpEx}") !== false && strpos($url, substr($user->page['root_script_path'], 0, -1)) !== false)
|
||||
if (strpos($url, ".{$phpEx}") !== false && strpos($url, $check_path) !== false)
|
||||
{
|
||||
$server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
|
||||
|
||||
@@ -816,7 +818,7 @@ class bbcode_firstpass extends bbcode
|
||||
|
||||
// Check again in correct order...
|
||||
$pos_ext = strpos($url, ".{$phpEx}");
|
||||
$pos_path = strpos($url, substr($user->page['root_script_path'], 0, -1));
|
||||
$pos_path = strpos($url, $check_path);
|
||||
$pos_domain = strpos($url, $server_name);
|
||||
|
||||
if ($pos_domain !== false && $pos_path >= $pos_domain && $pos_ext >= $pos_path)
|
||||
|
@@ -51,7 +51,7 @@ class session
|
||||
// Now, remove the sid and let us get a clean query string...
|
||||
foreach ($args as $key => $argument)
|
||||
{
|
||||
if (strpos($argument, 'sid=') === 0)
|
||||
if (strpos($argument, 'sid=') === 0 || strpos($argument, '_f_=') === 0)
|
||||
{
|
||||
unset($args[$key]);
|
||||
break;
|
||||
@@ -143,7 +143,8 @@ class session
|
||||
$this->host = (!empty($_SERVER['HTTP_HOST'])) ? (string) $_SERVER['HTTP_HOST'] : 'localhost';
|
||||
$this->page = $this->extract_current_page($phpbb_root_path);
|
||||
|
||||
$this->page['page'] .= (isset($_POST['f'])) ? ((strpos($this->page['page'], '?') !== false) ? '&' : '?') . 'f=' . intval($_POST['f']) : '';
|
||||
// Add forum to the page for tracking online users - also adding a "x" to the end to properly identify the number
|
||||
$this->page['page'] .= (isset($_REQUEST['f'])) ? ((strpos($this->page['page'], '?') !== false) ? '&' : '?') . '_f_=' . (int) $_REQUEST['f'] . 'x' : '';
|
||||
|
||||
if (isset($_COOKIE[$config['cookie_name'] . '_sid']) || isset($_COOKIE[$config['cookie_name'] . '_u']))
|
||||
{
|
||||
@@ -420,7 +421,7 @@ class session
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
if ($this->data['user_id'] != ANONYMOUS)
|
||||
if ($this->data['user_id'] != ANONYMOUS && !$bot)
|
||||
{
|
||||
$this->data['session_last_visit'] = (isset($this->data['session_time']) && $this->data['session_time']) ? $this->data['session_time'] : (($this->data['user_lastvisit']) ? $this->data['user_lastvisit'] : time());
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@ function compose_pm($id, $mode, $action)
|
||||
global $phpbb_root_path, $phpEx, $config;
|
||||
|
||||
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
|
||||
|
||||
if (!$action)
|
||||
@@ -572,7 +573,6 @@ function compose_pm($id, $mode, $action)
|
||||
// Attachment Preview
|
||||
if (sizeof($message_parser->attachment_data))
|
||||
{
|
||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
$extensions = $update_count = array();
|
||||
|
||||
$template->assign_var('S_HAS_ATTACHMENTS', true);
|
||||
@@ -818,23 +818,7 @@ function compose_pm($id, $mode, $action)
|
||||
);
|
||||
|
||||
// Build custom bbcodes array
|
||||
$sql = 'SELECT bbcode_id, bbcode_tag
|
||||
FROM ' . BBCODES_TABLE . '
|
||||
WHERE display_on_posting = 1';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$i = 0;
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$template->assign_block_vars('custom_tags', array(
|
||||
'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
|
||||
'BBCODE_ID' => 22 + ($i * 2),
|
||||
'BBCODE_TAG' => $row['bbcode_tag'])
|
||||
);
|
||||
|
||||
$i++;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
display_custom_bbcodes();
|
||||
|
||||
// Attachment entry
|
||||
if ($auth->acl_get('u_pm_attach') && $config['allow_pm_attach'] && $form_enctype)
|
||||
|
@@ -225,7 +225,7 @@ class ucp_profile
|
||||
'S_CHANGE_EMAIL' => ($auth->acl_get('u_chgemail')) ? true : false,
|
||||
'S_CHANGE_PASSWORD' => ($auth->acl_get('u_chgpasswd')) ? true : false)
|
||||
);
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'profile_info':
|
||||
|
||||
@@ -399,7 +399,7 @@ class ucp_profile
|
||||
|
||||
$cp->generate_profile_fields('profile', $user->get_iso_lang_id());
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'signature':
|
||||
|
||||
@@ -408,7 +408,8 @@ class ucp_profile
|
||||
trigger_error('NO_AUTH_SIGNATURE');
|
||||
}
|
||||
|
||||
include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
|
||||
$enable_bbcode = ($config['allow_sig_bbcode']) ? request_var('enable_bbcode', $user->optionget('bbcode')) : false;
|
||||
$enable_smilies = ($config['allow_sig_smilies']) ? request_var('enable_smilies', $user->optionget('smilies')) : false;
|
||||
@@ -486,23 +487,7 @@ class ucp_profile
|
||||
);
|
||||
|
||||
// Build custom bbcodes array
|
||||
$sql = 'SELECT bbcode_id, bbcode_tag
|
||||
FROM ' . BBCODES_TABLE . '
|
||||
WHERE display_on_posting = 1';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$i = 0;
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$template->assign_block_vars('custom_tags', array(
|
||||
'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
|
||||
'BBCODE_ID' => 22 + ($i * 2),
|
||||
'BBCODE_TAG' => $row['bbcode_tag'])
|
||||
);
|
||||
|
||||
$i++;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
display_custom_bbcodes();
|
||||
|
||||
break;
|
||||
|
||||
@@ -665,7 +650,7 @@ class ucp_profile
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
|
Reference in New Issue
Block a user