Bug #54732 [Opn->Nab]: the string replacement of CRLF does not work consistently
| From: | mike@php.net | Date: | Fri, 06 Dec 2013 07:28:55 +0000 |
| Subject: | Bug #54732 [Opn->Nab]: the string replacement of CRLF does not work consistently | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-183167@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54732&edit=1
ID: 54732
Updated by: mike@php.net
Reported by: suncoast dot adsl at yahoo dot com dot au
Summary: the string replacement of CRLF does not work
consistently
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: All
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2011-05-14 01:25:47] 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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54732&edit=1