diff options
author | Marc Alexander <admin@m-a-styles.de> | 2016-09-24 10:03:58 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-09-24 10:03:58 +0200 |
commit | e02dc7a9c154b059b2d89717fb6f3502c94100a2 (patch) | |
tree | 3e6d0e858c71eabd3ff8dcea74c9b320c6daad21 /phpBB/phpbb | |
parent | 4db52518a901ffcd31957d81c245152d1123fdd8 (diff) | |
parent | 931582aad9c041ebc9ae51d9a2664b4944a31be8 (diff) | |
download | forums-e02dc7a9c154b059b2d89717fb6f3502c94100a2.tar forums-e02dc7a9c154b059b2d89717fb6f3502c94100a2.tar.gz forums-e02dc7a9c154b059b2d89717fb6f3502c94100a2.tar.bz2 forums-e02dc7a9c154b059b2d89717fb6f3502c94100a2.tar.xz forums-e02dc7a9c154b059b2d89717fb6f3502c94100a2.zip |
Merge branch '3.1.x' into 3.2.x
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/session.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index 518cee4705..cbe2f02851 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -219,7 +219,7 @@ class session function session_begin($update_session_page = true) { global $phpEx, $SID, $_SID, $_EXTRA_URL, $db, $config, $phpbb_root_path; - global $request, $phpbb_container, $user, $phpbb_log; + global $request, $phpbb_container, $user, $phpbb_log, $phpbb_dispatcher; // Give us some basic information $this->time_now = time(); @@ -281,11 +281,21 @@ class session // 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 - $ips = explode(' ', trim($this->ip)); + $ips = explode(' ', trim($ip)); // Default IP if REMOTE_ADDR is invalid $this->ip = '127.0.0.1'; |