php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76919 REMOTE_ADDR in square brackets
Submitted: 2018-09-23 08:47 UTC Modified: 2019-03-12 08:59 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: a dot schilder at gmx dot de Assigned:
Status: Duplicate Package: Built-in web server
PHP Version: 7.3.0RC1 OS: Windows 10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: a dot schilder at gmx dot de
New email:
PHP Version: OS:

 

 [2018-09-23 08:47 UTC] a dot schilder at gmx dot de
Description:
------------
One of my scripts failed because the built-in web server returned the IPv6 value in $_SERVER['REMOTE_ADDR'] with square brackets.

The value was '[::1]' (PHP 7.3RC1) instead of '::1' (PHP 7.2.4), although it is no used as a host here (see RFC 3986, 3.2.2).

BTW: Also filter_var('[::1]', FILTER_VALIDATE_IP) fails (as expected).

Test script:
---------------
echo $_SERVER['REMOTE_ADDR']

Expected result:
----------------
::1

Actual result:
--------------
[::1]

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-09-23 10:01 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2018-09-23 10:01 UTC] cmb@php.net
That seems to be an unintended side effect of fixing bug #76136.
 [2019-03-12 08:59 UTC] nikic@php.net
-Status: Verified +Status: Duplicate
 [2019-03-12 08:59 UTC] nikic@php.net
Same issue as bug #77722, which is now fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC