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 // Increase number of revision after update
$bb_cfg['tp_version'] = '2.0.2'; $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['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 $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>'; 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) 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']; $sig = isset($_POST['user_sig']) ? (string) $_POST['user_sig'] : $pr_data['user_sig'];
if ($submit) if ($submit)
{ {
$sig_esc = prepare_message($sig);
if (mb_strlen($sig) > $bb_cfg['max_sig_chars']) if (mb_strlen($sig) > $bb_cfg['max_sig_chars'])
{ {
$errors[] = $lang['SIGNATURE_TOO_LONG']; $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']) : ''; $username = ( !empty($_POST['username']) ) ? clean_username($_POST['username']) : '';
$subject = ( !empty($_POST['subject']) ) ? clean_title($_POST['subject']) : ''; $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_title = ( !empty($_POST['poll_title']) ) ? clean_title($_POST['poll_title']) : '';
$poll_length = ( isset($_POST['poll_length']) ) ? max(0, intval($_POST['poll_length'])) : 0; $poll_length = ( isset($_POST['poll_length']) ) ? max(0, intval($_POST['poll_length'])) : 0;
@ -594,15 +594,16 @@ if( $refresh || isset($_POST['del_poll_option']) || $error_msg || ($submit && $t
{ {
$preview_subject = $subject; $preview_subject = $subject;
$preview_username = $username; $preview_username = $username;
$preview_message = bbcode2html($message); $preview_message = htmlCHR($message, false, ENT_NOQUOTES);
$preview_message = bbcode2html($preview_message);
$template->assign_vars(array( $template->assign_vars(array(
'TPL_PREVIEW_POST' => true, 'TPL_PREVIEW_POST' => true,
'TOPIC_TITLE' => wbr($preview_subject), 'TOPIC_TITLE' => wbr($preview_subject),
'POST_SUBJECT' => $preview_subject, 'POST_SUBJECT' => $preview_subject,
'POSTER_NAME' => $preview_username, 'POSTER_NAME' => $preview_username,
'POST_DATE' => bb_date(TIMENOW), 'POST_DATE' => bb_date(TIMENOW),
'PREVIEW_MSG' => $preview_message, 'PREVIEW_MSG' => $preview_message,
)); ));
} }
} }

View file

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