mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-23 10:28:55 +00:00
my attempt to break the source. :D
The Cache-Control change may stay or may not stay. fixed: php3 compliance within the emailer. :) git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@4073 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
efe6ed8753
commit
c24b7f81b1
5 changed files with 26 additions and 8 deletions
|
@ -16,7 +16,7 @@ define('IN_PHPBB', 1);
|
||||||
if( !empty($setmodules) )
|
if( !empty($setmodules) )
|
||||||
{
|
{
|
||||||
$file = basename(__FILE__);
|
$file = basename(__FILE__);
|
||||||
$module['General']['Configuration'] = "$file?mode=config";
|
$module['General']['Configuration'] = "$file";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,10 +130,21 @@ 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 );
|
$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('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.16\..*/', '/^10\..*/', '/^224\..*/', '/^240\..*/');
|
$entry = trim($entry);
|
||||||
$client_ip = preg_replace($private_ip, $client_ip, $ip_list[1]);
|
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\.16\..*/', '/^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
|
else
|
||||||
|
|
|
@ -115,6 +115,8 @@ p,ul,td {font-size:10pt;}
|
||||||
<li>Added mail header X-MimeOLE to the emailer class</li>
|
<li>Added mail header X-MimeOLE to the emailer class</li>
|
||||||
<li>Prevent registration if user is logged in or user trying to register a second time</li>
|
<li>Prevent registration if user is logged in or user trying to register a second time</li>
|
||||||
<li>Prevent usage of ALT-255 in Usernames</li>
|
<li>Prevent usage of ALT-255 in Usernames</li>
|
||||||
|
<li>Fixed IP retrieval for users with two proxy setups while the first proxy is hiding the clients IP Address - <b>cosmos</b></li>
|
||||||
|
<li>Fixed Cache-Control header for correctly resetting cookies - <b>cosmos</b></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="203"></a><h3 class="h3">1.ii. Changes since 2.0.3</h3>
|
<a name="203"></a><h3 class="h3">1.ii. Changes since 2.0.3</h3>
|
||||||
|
|
|
@ -148,7 +148,8 @@ class emailer
|
||||||
$this->msg = preg_replace('#\{([a-z0-9\-_]*?)\}#is', "' . $\\1 . '", $this->msg);
|
$this->msg = preg_replace('#\{([a-z0-9\-_]*?)\}#is', "' . $\\1 . '", $this->msg);
|
||||||
|
|
||||||
// Set vars
|
// Set vars
|
||||||
foreach ($this->vars as $key => $val)
|
reset ($this->vars);
|
||||||
|
while (list($key, $val) = each($this->vars))
|
||||||
{
|
{
|
||||||
$$key = $val;
|
$$key = $val;
|
||||||
}
|
}
|
||||||
|
@ -156,7 +157,8 @@ class emailer
|
||||||
eval("\$this->msg = '$this->msg';");
|
eval("\$this->msg = '$this->msg';");
|
||||||
|
|
||||||
// Clear vars
|
// Clear vars
|
||||||
foreach ($this->vars as $key => $val)
|
reset ($this->vars);
|
||||||
|
while (list($key, $val) = each($this->vars))
|
||||||
{
|
{
|
||||||
unset($$key);
|
unset($$key);
|
||||||
}
|
}
|
||||||
|
|
|
@ -461,15 +461,18 @@ else
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add no-cache control for cookies if they are set
|
||||||
|
$c_no_cache = (isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_data'])) ? 'no-cache="set-cookie", ' : '';
|
||||||
|
|
||||||
// Work around for "current" Apache 2 + PHP module which seems to not
|
// Work around for "current" Apache 2 + PHP module which seems to not
|
||||||
// cope with private cache control setting
|
// cope with private cache control setting
|
||||||
if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2'))
|
if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2'))
|
||||||
{
|
{
|
||||||
header ('Cache-Control: no-cache, pre-check=0, post-check=0, max-age=0');
|
header ('Cache-Control: ' . $c_no_cache . 'no-cache, pre-check=0, post-check=0, max-age=0');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
|
header ('Cache-Control: ' . $c_no_cache . 'private, pre-check=0, post-check=0, max-age=0');
|
||||||
}
|
}
|
||||||
header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
|
header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
|
||||||
header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||||
|
|
Loading…
Add table
Reference in a new issue