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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Mar 29 07:01:28 2024 UTC