php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71674 gethostbyname not return unmodified hostname
Submitted: 2016-02-26 23:03 UTC Modified: 2016-02-27 01:05 UTC
From: spacek at best-net dot cz Assigned:
Status: Duplicate Package: Network related
PHP Version: 7.0.3 OS: Unix
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: spacek at best-net dot cz
New email:
PHP Version: OS:

 

 [2016-02-26 23:03 UTC] spacek at best-net dot cz
Description:
------------
Function gethostbyname() not return unmodified hostname in situation when the input string contains only numbers.

Tested in:
PHP 7.0.3
PHP 5.6.18

Test script:
---------------
<?php

echo gethostbyname('1111111').PHP_EOL;
echo gethostbyname('111').PHP_EOL;
echo gethostbyname('111.111').PHP_EOL;
echo gethostbyname('111768768768768768.com').PHP_EOL;
echo gethostbyname('a111').PHP_EOL;
echo gethostbyname('foo').PHP_EOL;


Expected result:
----------------
0.16.244.71
0.0.0.111
111.0.0.111
111768768768768768.com
a111
foo


Actual result:
--------------
0.16.244.71
0.0.0.111
a111
foo


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-02-26 23:08 UTC] spacek at best-net dot cz
-Status: Open +Status: Closed
 [2016-02-26 23:08 UTC] spacek at best-net dot cz
bad comment
 [2016-02-27 01:05 UTC] requinix@php.net
-Status: Closed +Status: Duplicate
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC