More fixes and updates

git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3091 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2002-11-25 18:04:51 +00:00
parent f7b6abc407
commit d866cedd1c
9 changed files with 17 additions and 11 deletions

View file

@ -154,7 +154,7 @@ if( getenv('HTTP_X_FORWARDED_FOR') != '' )
if ( preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", getenv('HTTP_X_FORWARDED_FOR'), $ip_list) ) if ( preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", getenv('HTTP_X_FORWARDED_FOR'), $ip_list) )
{ {
$private_ip = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.16\..*/', '/^10..*/', '/^224..*/', '/^240..*/'); $private_ip = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.16\..*/', '/^10.\.*/', '/^224.\.*/', '/^240.\.*/');
$client_ip = preg_replace($private_ip, $client_ip, $ip_list[1]); $client_ip = preg_replace($private_ip, $client_ip, $ip_list[1]);
} }
} }

View file

@ -318,7 +318,7 @@ CREATE TABLE [phpbb_users] (
[user_regdate] [int] NOT NULL , [user_regdate] [int] NOT NULL ,
[user_level] [smallint] NOT NULL , [user_level] [smallint] NOT NULL ,
[user_posts] [int] NOT NULL , [user_posts] [int] NOT NULL ,
[user_timezone] [decimal] (4,2) NOT NULL , [user_timezone] [decimal] (5,2) NOT NULL ,
[user_style] [int] NULL , [user_style] [int] NULL ,
[user_lang] [varchar] (255) NULL , [user_lang] [varchar] (255) NULL ,
[user_dateformat] [varchar] (14) NOT NULL , [user_dateformat] [varchar] (14) NOT NULL ,

View file

@ -464,7 +464,7 @@ CREATE TABLE phpbb_users (
user_regdate int(11) DEFAULT '0' NOT NULL, user_regdate int(11) DEFAULT '0' NOT NULL,
user_level tinyint(4) DEFAULT '0', user_level tinyint(4) DEFAULT '0',
user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
user_timezone decimal(4,2) DEFAULT '0' NOT NULL, user_timezone decimal(5,2) DEFAULT '0' NOT NULL,
user_style tinyint(4), user_style tinyint(4),
user_lang varchar(255), user_lang varchar(255),
user_dateformat varchar(14) DEFAULT 'd M Y H:i' NOT NULL, user_dateformat varchar(14) DEFAULT 'd M Y H:i' NOT NULL,

View file

@ -479,7 +479,7 @@ CREATE TABLE phpbb_users (
user_avatar_type int2 DEFAULT '0' NOT NULL, user_avatar_type int2 DEFAULT '0' NOT NULL,
user_level int4 DEFAULT '1', user_level int4 DEFAULT '1',
user_lang varchar(255), user_lang varchar(255),
user_timezone decimal(4) DEFAULT '0' NOT NULL, user_timezone decimal(5) DEFAULT '0' NOT NULL,
user_dateformat varchar(14) DEFAULT 'd M Y H:m' NOT NULL, user_dateformat varchar(14) DEFAULT 'd M Y H:m' NOT NULL,
user_notify_pm int2 DEFAULT '1' NOT NULL, user_notify_pm int2 DEFAULT '1' NOT NULL,
user_popup_pm int2 DEFAULT '0' NOT NULL, user_popup_pm int2 DEFAULT '0' NOT NULL,

View file

@ -87,6 +87,10 @@ h3 {font-size:12pt;color:blue}
<li>Remove email to group moderator when approving new members</li> <li>Remove email to group moderator when approving new members</li>
<li>Fixed non-handling of HTML in poll options</li> <li>Fixed non-handling of HTML in poll options</li>
<li>Fixed non-deletion of polls when deleting forum and its posts</li> <li>Fixed non-deletion of polls when deleting forum and its posts</li>
<li>Fixed moved shadow topic from being bumped upon reply</li>
<li>Changed field size of timezone to decimal(5,2) where applicable</li>
<li>Fixed missing sid append to URL when redirecting to newest reply</li>
<li>Fixed missing slashes in private IP preg check</li>
<li></li> <li></li>
<li></li> <li></li>
<li></li> <li></li>

View file

@ -452,8 +452,7 @@ function update_post_stats(&$mode, &$post_data, &$forum_id, &$topic_id, &$post_i
{ {
$sql = "UPDATE " . TOPICS_TABLE . " SET $sql = "UPDATE " . TOPICS_TABLE . " SET
$topic_update_sql $topic_update_sql
WHERE topic_id = $topic_id WHERE topic_id = $topic_id";
OR topic_moved_id = $topic_id";
if ( !$db->sql_query($sql) ) if ( !$db->sql_query($sql) )
{ {
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);

View file

@ -101,7 +101,7 @@ if (
{ {
if ( !empty($HTTP_POST_VARS[$param]) ) if ( !empty($HTTP_POST_VARS[$param]) )
{ {
$$var = trim(htmlspecialchars(strip_tags($HTTP_POST_VARS[$param]))); $$var = trim(htmlspecialchars($HTTP_POST_VARS[$param]));
} }
} }

View file

@ -447,6 +447,7 @@ switch ( $row['config_value'] )
case '.0.3': case '.0.3':
// Need to add index to post_id in search_wordmatch (mysql, postgresql, msaccess ... both indexes) // Need to add index to post_id in search_wordmatch (mysql, postgresql, msaccess ... both indexes)
// Modify user_timezone to decimal(5,2) ... not for pgsql though
// Add auto_increment equiv to groups table (Doug overlooked it ...) for pgsql and msaccess // Add auto_increment equiv to groups table (Doug overlooked it ...) for pgsql and msaccess
//mysql //mysql

View file

@ -60,9 +60,9 @@ if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) )
{ {
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) ) if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_GET_VARS['sid']) )
{ {
$session_id = $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']; $session_id = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid'] : $HTTP_GET_VARS['sid'];
if ( $session_id ) if ( $session_id )
{ {
@ -86,6 +86,8 @@ if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) )
$db->sql_close(); $db->sql_close();
$post_id = $row['post_id']; $post_id = $row['post_id'];
$SID = (isset($HTTP_GET_VARS['sid'])) ? 'sid=' . $session_id : '';
header($header_location . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id", true)); header($header_location . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id", true));
exit; exit;
} }
@ -1092,11 +1094,11 @@ for($i = 0; $i < $total_posts; $i++)
{ {
if ( $user_sig != '' ) if ( $user_sig != '' )
{ {
$user_sig = preg_replace($orig_word, $replacement_word, $user_sig); $user_sig = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(' . $orig_word . ', ' . $replacement_word . ', '\\0')", '>' . $user_sig . '<'), 1, -1));
} }
$post_subject = preg_replace($orig_word, $replacement_word, $post_subject); $post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
$message = preg_replace($orig_word, $replacement_word, $message); $message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(' . $orig_word . ', ' . $replacement_word . ', '\\0')", '>' . $message . '<'), 1, -1));
} }
// //