mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-26 01:43:45 +02:00
This commit was manufactured by cvs2svn to create tag
'release_2_0_7'. git-svn-id: file:///svn/phpbb/tags/release_2_0_7@4865 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -101,18 +101,19 @@ if( !get_magic_quotes_gpc() )
|
||||
// malicious rewriting of language and otherarray values via
|
||||
// URI params
|
||||
//
|
||||
$board_config = Array();
|
||||
$userdata = Array();
|
||||
$theme = Array();
|
||||
$images = Array();
|
||||
$lang = Array();
|
||||
$board_config = array();
|
||||
$userdata = array();
|
||||
$theme = array();
|
||||
$images = array();
|
||||
$lang = array();
|
||||
$gen_simple_header = FALSE;
|
||||
|
||||
@include($phpbb_root_path . 'config.'.$phpEx);
|
||||
include($phpbb_root_path . 'config.'.$phpEx);
|
||||
|
||||
if( !defined("PHPBB_INSTALLED") )
|
||||
{
|
||||
header("Location: install.$phpEx");
|
||||
header("Location: install/install.$phpEx");
|
||||
exit;
|
||||
}
|
||||
|
||||
include($phpbb_root_path . 'includes/constants.'.$phpEx);
|
||||
@@ -122,28 +123,6 @@ include($phpbb_root_path . 'includes/auth.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/db.'.$phpEx);
|
||||
|
||||
//
|
||||
// Mozilla navigation bar
|
||||
// Default items that should be valid on all pages.
|
||||
// Defined here and not in page_header.php so they can be redefined in the code
|
||||
//
|
||||
$nav_links['top'] = array (
|
||||
'url' => append_sid($phpbb_root_dir."index.".$phpEx),
|
||||
'title' => sprintf($lang['Forum_Index'], $board_config['sitename'])
|
||||
);
|
||||
$nav_links['search'] = array (
|
||||
'url' => append_sid($phpbb_root_dir."search.".$phpEx),
|
||||
'title' => $lang['Search']
|
||||
);
|
||||
$nav_links['help'] = array (
|
||||
'url' => append_sid($phpbb_root_dir."faq.".$phpEx),
|
||||
'title' => $lang['FAQ']
|
||||
);
|
||||
$nav_links['author'] = array (
|
||||
'url' => append_sid($phpbb_root_dir."memberlist.".$phpEx),
|
||||
'title' => $lang['Memberlist']
|
||||
);
|
||||
|
||||
//
|
||||
// Obtain and encode users IP
|
||||
//
|
||||
@@ -151,10 +130,22 @@ if( getenv('HTTP_X_FORWARDED_FOR') != '' )
|
||||
{
|
||||
$client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $REMOTE_ADDR );
|
||||
|
||||
if ( preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", getenv('HTTP_X_FORWARDED_FOR'), $ip_list) )
|
||||
$entries = explode(',', getenv('HTTP_X_FORWARDED_FOR'));
|
||||
reset($entries);
|
||||
while (list(, $entry) = each($entries))
|
||||
{
|
||||
$private_ip = array('/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.16\..*/', '/^10..*/', '/^224..*/', '/^240..*/');
|
||||
$client_ip = preg_replace($private_ip, $client_ip, $ip_list[1]);
|
||||
$entry = trim($entry);
|
||||
if ( preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", $entry, $ip_list) )
|
||||
{
|
||||
$private_ip = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.((1[6-9])|(2[0-9])|(3[0-1]))\..*/', '/^10\..*/', '/^224\..*/', '/^240\..*/');
|
||||
$found_ip = preg_replace($private_ip, $client_ip, $ip_list[1]);
|
||||
|
||||
if ($client_ip != $found_ip)
|
||||
{
|
||||
$client_ip = $found_ip;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -170,16 +161,19 @@ $user_ip = encode_ip($client_ip);
|
||||
//
|
||||
$sql = "SELECT *
|
||||
FROM " . CONFIG_TABLE;
|
||||
if(!$result = $db->sql_query($sql))
|
||||
if( !($result = $db->sql_query($sql)) )
|
||||
{
|
||||
message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
else
|
||||
|
||||
while ( $row = $db->sql_fetchrow($result) )
|
||||
{
|
||||
while($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$board_config[$row['config_name']] = $row['config_value'];
|
||||
}
|
||||
$board_config[$row['config_name']] = $row['config_value'];
|
||||
}
|
||||
|
||||
if (file_exists('install') || file_exists('contrib'))
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, 'Please ensure both the install/ and contrib/ directories are deleted');
|
||||
}
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user