php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54732 the string replacement of CRLF does not work consistently
Submitted: 2011-05-14 01:25 UTC Modified: 2013-12-06 07:28 UTC
From: suncoast dot adsl at yahoo dot com dot au Assigned:
Status: Not a bug Package: *General Issues
PHP Version: Irrelevant OS: All
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: suncoast dot adsl at yahoo dot com dot au
New email:
PHP Version: OS:

 

 [2011-05-14 01:25 UTC] suncoast dot adsl at yahoo dot com dot au
Description:
------------
No matter how many ways CRLF (\r\n) has been tried to be replaced in a PHP script by <BR>, it does not produce a consistent result.

This happens especially when trying to parse returned whois information.

The $info in the following script will work with some parsing of the whois info with a string replacement of a CRLF (\r\n) on one domain (registrar) and yet on a different domain it will not work at all.

I have looked at the differing outputs (depending on domain name) with a HEX editor and I know for a fact that there is a replacement problem with CRLF and php. I have tried A LOT of various scripts from people having the same problem, with no further success. The replacement of \r\n should be straight forward as in other languages but it is not in php. Perhaps a special function should be made for the task of replacemet of CRLF with another character.

Have a look at the code below. Try different domain names and notice how the CRLF is parsed (with your own code to parse $info) on some domain information it will work and yet other domains it will not parse the CRLF (HEX-ODOA)!

This is an ongoing problem for other people as well. 

Test script:
---------------
<?php
 
    require_once "Net/Whois.php";
 
    $whois = new Net_Whois();
    /* You can add other NIC server as a second parameter. */
    $info = $whois->query('example.com');
    echo($info);
 
?> 


Expected result:
----------------
Please fix this string replacement problem _PLEASE.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-06 07:28 UTC] mike@php.net
-Status: Open +Status: Not a bug
 [2013-12-06 07:28 UTC] mike@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 22:01:29 2024 UTC