|
From: Paul S. O. <ps...@us...> - 2002-01-28 18:47:44
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv30131
Modified Files:
posting.php
Log Message:
Initial warning fixes
Index: posting.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/posting.php,v
retrieving revision 1.141
retrieving revision 1.142
diff -C2 -r1.141 -r1.142
*** posting.php 2002/01/28 12:05:00 1.141
--- posting.php 2002/01/28 18:47:41 1.142
***************
*** 69,73 ****
// Start session management
//
! $userdata = session_pagestart($user_ip, $forum_id, $board_config['session_length']);
init_userprefs($userdata);
//
--- 69,73 ----
// Start session management
//
! $userdata = session_pagestart($user_ip, $forum_id);
init_userprefs($userdata);
//
***************
*** 234,237 ****
--- 234,238 ----
$html_entities_match = array("#&#", "#<#", "#>#", "#\"#");
$html_entities_replace = array("&", "<", ">", """);
+ $error = false;
$submit = ( isset($HTTP_POST_VARS['submit']) ) ? TRUE : 0;
***************
*** 345,349 ****
// Start session management
//
! $userdata = session_pagestart($user_ip, PAGE_POSTING, $board_config['session_length']);
init_userprefs($userdata);
//
--- 346,350 ----
// Start session management
//
! $userdata = session_pagestart($user_ip, PAGE_POSTING);
init_userprefs($userdata);
//
***************
*** 559,573 ****
{
$is_auth_type = "auth_announce";
- $auth_string = $lang['can_post_announcements'];
}
else if( $topic_type == POST_STICKY )
{
$is_auth_type = "auth_sticky";
- $auth_string = $lang['can_post_sticky_topics'];
}
else
{
$is_auth_type = "auth_post";
- $auth_string = $lang['can_post_new_topics'];
}
break;
--- 560,571 ----
***************
*** 576,600 ****
case 'quote':
$is_auth_type = "auth_reply";
- $auth_string = $lang['can_reply_to_topics'];
break;
case 'editpost':
$is_auth_type = "auth_edit";
- $auth_string = $lang['can_edit_topics'];
break;
case 'delete':
$is_auth_type = "auth_delete";
- $auth_string = $lang['can_delete_topics'];
break;
case 'vote':
$is_auth_type = "auth_vote";
- $auth_string = $lang['can_vote'];
break;
case 'topicreview':
$is_auth_type = "auth_read";
- $auth_string = $lang['can_read'];
break;
--- 574,593 ----
***************
*** 700,706 ****
if( $submit && $mode != "vote" )
{
! $post_username = trim(strip_tags($HTTP_POST_VARS['username']));
! if( !empty($post_username) )
{
if( !validate_username(stripslashes($post_username)) )
{
--- 693,700 ----
if( $submit && $mode != "vote" )
{
! if( !empty($HTTP_POST_VARS['username']) )
{
+ $post_username = trim(strip_tags($HTTP_POST_VARS['username']));
+
if( !validate_username(stripslashes($post_username)) )
{
***************
*** 718,742 ****
}
! $post_subject = trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['subject'])));
! if( ( $mode == "newtopic" || ( $mode == "editpost" && $is_first_post_topic ) ) && empty($post_subject) )
{
! $error = TRUE;
! if( !empty($error_msg) )
{
! $error_msg .= "<br />";
}
- $error_msg .= $lang['Empty_subject'];
}
! $post_message = trim($HTTP_POST_VARS['message']);
! if( !empty($post_message) )
{
if( !$error )
{
! if( $bbcode_on )
! {
! $bbcode_uid = make_bbcode_uid();
! }
!
$post_message = prepare_message($post_message, $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
}
--- 712,740 ----
}
! if( !empty($HTTP_POST_VARS['subject']) )
{
! $post_subject = trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['subject'])));
! }
! else
! {
! $post_subject = "";
! if( ( $mode == "newtopic" || ( $mode == "editpost" && $is_first_post_topic ) ) && empty($post_subject) )
{
! $error = TRUE;
! if( !empty($error_msg) )
! {
! $error_msg .= "<br />";
! }
! $error_msg .= $lang['Empty_subject'];
}
}
! if( !empty($HTTP_POST_VARS['message']) )
{
+ $post_message = trim($HTTP_POST_VARS['message']);
+
if( !$error )
{
! $bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : "";
$post_message = prepare_message($post_message, $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
}
***************
*** 2204,2214 ****
$replacement_word = array();
$result = obtain_word_list($orig_word, $replacement_word);
-
- if( $bbcode_on )
- {
- $bbcode_uid = make_bbcode_uid();
- }
! $preview_subject = $post_subject;
$preview_message = stripslashes(prepare_message($post_message, $html_on, $bbcode_on, $smilies_on, $bbcode_uid));
--- 2202,2207 ----
$replacement_word = array();
$result = obtain_word_list($orig_word, $replacement_word);
! $bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : "";
$preview_message = stripslashes(prepare_message($post_message, $html_on, $bbcode_on, $smilies_on, $bbcode_uid));
***************
*** 2239,2246 ****
}
! if( count($orig_word) )
{
! $preview_subject = preg_replace($orig_word, $replacement_word, $preview_subject);
! $preview_message = preg_replace($orig_word, $replacement_word, $preview_message);
}
--- 2232,2240 ----
}
! if( !empty($orig_word) )
{
! $preview_username = ( !empty($post_username) ) ? preg_replace($orig_word, $replacement_word, $post_username) : "";
! $preview_subject = ( !empty($post_subject) ) ? preg_replace($orig_word, $replacement_word, $post_subject) : "";
! $preview_message = ( !empty($preview_message) ) ? preg_replace($orig_word, $replacement_word, $preview_message) : "";
}
***************
*** 2259,2263 ****
"TOPIC_TITLE" => $preview_subject,
"POST_SUBJECT" => $preview_subject,
! "POSTER_NAME" => $username,
"POST_DATE" => create_date($board_config['default_dateformat'], time(), $board_config['board_timezone']),
"MESSAGE" => $preview_message,
--- 2253,2257 ----
"TOPIC_TITLE" => $preview_subject,
"POST_SUBJECT" => $preview_subject,
! "POSTER_NAME" => $preview_username,
"POST_DATE" => create_date($board_config['default_dateformat'], time(), $board_config['board_timezone']),
"MESSAGE" => $preview_message,
***************
*** 2553,2557 ****
}
! if( is_array($poll_option_list) )
{
while( list($option_id, $option_text) = each($poll_option_list) )
--- 2547,2551 ----
}
! if( isset($poll_option_list) )
{
while( list($option_id, $option_text) = each($poll_option_list) )
|