phpBB

Code Changes

File: phpbb/session.php

  Unmodified   Added   Modified   Removed
Line 219Line 219
	function session_begin($update_session_page = true)
{
global $phpEx, $SID, $_SID, $_EXTRA_URL, $db, $config, $phpbb_root_path;

	function session_begin($update_session_page = true)
{
global $phpEx, $SID, $_SID, $_EXTRA_URL, $db, $config, $phpbb_root_path;

		global $request, $phpbb_container;

		global $request, $phpbb_container, $phpbb_dispatcher;


// Give us some basic information
$this->time_now = time();


// Give us some basic information
$this->time_now = time();

Line 281Line 281

// Why no forwarded_for et al? Well, too easily spoofed. With the results of my recent requests
// it's pretty clear that in the majority of cases you'll at least be left with a proxy/cache ip.


// Why no forwarded_for et al? Well, too easily spoofed. With the results of my recent requests
// it's pretty clear that in the majority of cases you'll at least be left with a proxy/cache ip.

		$this->ip = htmlspecialchars_decode($request->server('REMOTE_ADDR'));
$this->ip = preg_replace('# {2,}#', ' ', str_replace(',', ' ', $this->ip));











		$ip = htmlspecialchars_decode($request->server('REMOTE_ADDR'));
$ip = preg_replace('# {2,}#', ' ', str_replace(',', ' ', $ip));

/**
* Event to alter user IP address
*
* @event core.session_ip_after
* @var string ip REMOTE_ADDR
* @since 3.1.10-RC1
*/
$vars = array('ip');
extract($phpbb_dispatcher->trigger_event('core.session_ip_after', compact($vars)));


// split the list of IPs


// split the list of IPs

		$ips = explode(' ', trim($this->ip));

		$ips = explode(' ', trim($ip));


// Default IP if REMOTE_ADDR is invalid
$this->ip = '127.0.0.1';


// Default IP if REMOTE_ADDR is invalid
$this->ip = '127.0.0.1';

Line 1585Line 1595

$this->data = array_merge($this->data, $sql_ary);



$this->data = array_merge($this->data, $sql_ary);


			if ($this->data['user_id'] != ANONYMOUS && !empty($config['new_member_post_limit']) && $this->data['user_new'] && $config['new_member_post_limit'] <= $this->data['user_posts'])

			if ($this->data['user_id'] != ANONYMOUS && isset($config['new_member_post_limit']) && $this->data['user_new'] && $config['new_member_post_limit'] <= $this->data['user_posts'])

			{
$this->leave_newly_registered();
}

			{
$this->leave_newly_registered();
}