git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@89 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
nanosimbiot 2011-07-05 16:32:57 +00:00
commit 920187016b
5 changed files with 19 additions and 12 deletions

View file

@ -57,7 +57,7 @@ $bb_cfg['css_ver'] = 1;
// Increase number of revision after update
$bb_cfg['tp_version'] = '2.0.2';
$bb_cfg['tp_release_state'] = 'TP II r86';
$bb_cfg['tp_release_state'] = 'TP II r89';
$bb_cfg['tp_release_date'] = '05-07-2011';
$bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger

View file

@ -505,9 +505,13 @@ function vdump ($var, $title = '')
echo '</pre>';
}
function htmlCHR ($txt, $replace_space = false)
function htmlCHR ($txt, $double_encode = false, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
return ($replace_space) ? str_replace(' ', '&nbsp;', htmlspecialchars($txt, ENT_QUOTES)) : htmlspecialchars($txt, ENT_QUOTES);
if (is_array($txt))
{
log_request('htmlCHR');
}
return (string) htmlspecialchars($txt, $quote_style, $charset, $double_encode);
}
function make_url ($path)

View file

@ -440,6 +440,8 @@ foreach ($profile_fields as $field => $can_edit)
$sig = isset($_POST['user_sig']) ? (string) $_POST['user_sig'] : $pr_data['user_sig'];
if ($submit)
{
$sig_esc = prepare_message($sig);
if (mb_strlen($sig) > $bb_cfg['max_sig_chars'])
{
$errors[] = $lang['SIGNATURE_TOO_LONG'];

View file

@ -563,7 +563,7 @@ if( $refresh || isset($_POST['del_poll_option']) || $error_msg || ($submit && $t
{
$username = ( !empty($_POST['username']) ) ? clean_username($_POST['username']) : '';
$subject = ( !empty($_POST['subject']) ) ? clean_title($_POST['subject']) : '';
$message = ( !empty($_POST['message']) ) ? $_POST['message'] : '';
$message = ( !empty($_POST['message']) ) ? prepare_message($_POST['message']) : '';
$poll_title = ( !empty($_POST['poll_title']) ) ? clean_title($_POST['poll_title']) : '';
$poll_length = ( isset($_POST['poll_length']) ) ? max(0, intval($_POST['poll_length'])) : 0;
@ -594,7 +594,8 @@ if( $refresh || isset($_POST['del_poll_option']) || $error_msg || ($submit && $t
{
$preview_subject = $subject;
$preview_username = $username;
$preview_message = bbcode2html($message);
$preview_message = htmlCHR($message, false, ENT_NOQUOTES);
$preview_message = bbcode2html($preview_message);
$template->assign_vars(array(
'TPL_PREVIEW_POST' => true,

View file

@ -985,7 +985,7 @@ else if ( $submit || $refresh || $mode != '' )
$error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['NO_TO_USER'];
}
$privmsg_subject = trim(strip_tags($_POST['subject']));
$privmsg_subject = htmlCHR($_POST['subject']);
if ( empty($privmsg_subject) )
{
$error = TRUE;
@ -996,7 +996,7 @@ else if ( $submit || $refresh || $mode != '' )
{
if ( !$error )
{
$privmsg_message = $_POST['message'];
$privmsg_message = prepare_message($_POST['message']);
}
}
else