Feature #37584

Reliable getClientIpAddress() method

Added by Robert Lemke almost 7 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Http
Start date:
2012-05-29
Due date:
% Done:

100%

PHP Version:
5.3
Has patch:
No
Complexity:
medium

Description

We need a reliable way to determine the user's IP address - even if he was passed through several proxies or if some other webserver than Apache was used.

Associated revisions

Revision 66bcdf54 (diff)
Added by Robert Lemke almost 7 years ago

[FEATURE] Provide way to determine client IP address

This adds a method getClientIpAddress() to the HTTP Request
class. It considers various kinds of environment variables
which are present when using proxies or certain server setups
for determining the actual client IP address.

Change-Id: I906efb9ae826ab4f4286be862ef8853105c27ae2
Resolves: #37584
Releases: 1.1, 1.2

Revision 744c7593 (diff)
Added by Robert Lemke almost 7 years ago

[BUGFIX] Fix IP address validation

The IP address validation done with filter_var() worked
on the development machine running PHP 5.3.12, however,
it failed on the integration server running PHP 5.3.5.
Apparently, the filter_var options for FILTER_VALIDATE_IP
behave differently in these versions.

This patch removes the validation for IPv4 / IPv6 addresses
because they didn't make sense anyway.

In that regard: hooray for PHP behavior changes. They actually
exploit bad application code. Sometimes.

Change-Id: I0df423b45426c0e65ce5ecbd894be4466816fe05
Releases: 1.1, 1.2
Related: #37584

Revision 253a9392 (diff)
Added by Robert Lemke almost 7 years ago

[FEATURE] Provide way to determine client IP address

This adds a method getClientIpAddress() to the HTTP Request
class. It considers various kinds of environment variables
which are present when using proxies or certain server setups
for determining the actual client IP address.

Change-Id: I906efb9ae826ab4f4286be862ef8853105c27ae2
Resolves: #37584
Releases: 1.1, 1.2

Revision aa1a0c5f (diff)
Added by Robert Lemke almost 7 years ago

[BUGFIX] Fix IP address validation

The IP address validation done with filter_var() worked
on the development machine running PHP 5.3.12, however,
it failed on the integration server running PHP 5.3.5.
Apparently, the filter_var options for FILTER_VALIDATE_IP
behave differently in these versions.

This patch removes the validation for IPv4 / IPv6 addresses
because they didn't make sense anyway.

In that regard: hooray for PHP behavior changes. They actually
exploit bad application code. Sometimes.

Change-Id: I0df423b45426c0e65ce5ecbd894be4466816fe05
Releases: 1.1, 1.2
Related: #37584

History

#1 Updated by Gerrit Code Review almost 7 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11699

#2 Updated by Gerrit Code Review almost 7 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11699

#3 Updated by Gerrit Code Review almost 7 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11699

#4 Updated by Gerrit Code Review almost 7 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11699

#5 Updated by Gerrit Code Review almost 7 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11699

#6 Updated by Gerrit Code Review almost 7 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11699

#7 Updated by Gerrit Code Review almost 7 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11699

#8 Updated by Robert Lemke almost 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#9 Updated by Gerrit Code Review almost 7 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch FLOW3-1.1 has been pushed to the review server.
It is available at http://review.typo3.org/11728

#10 Updated by Gerrit Code Review almost 7 years ago

Patch set 2 for branch FLOW3-1.1 has been pushed to the review server.
It is available at http://review.typo3.org/11728

#11 Updated by Gerrit Code Review almost 7 years ago

Patch set 3 for branch FLOW3-1.1 has been pushed to the review server.
It is available at http://review.typo3.org/11728

#12 Updated by Gerrit Code Review almost 7 years ago

Patch set 4 for branch FLOW3-1.1 has been pushed to the review server.
It is available at http://review.typo3.org/11728

#13 Updated by Robert Lemke almost 7 years ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF