Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001115 [Quercus] minor always 05-16-06 15:26 05-16-06 18:52
Reporter koreth View Status public  
Assigned To ferg
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.0.20 Product Version 3.0.20
  Product Build
Summary 0001115: fgets() on socket strips trailing cr/lf
Description PHP code:

<?php
$sock = @fsockopen("localhost", 2222);
$line = fgets($sock);
print "[" . $line . "]";
?>

I use "nc -l -p 2222" to listen on port 2222, then execute this page (piped through "od -xc" so I can see the exact output).

With Zend PHP, if I type "foo" into nc, I get "[foo\n]" as output. With Quercus, I get "[foo]". Trailing carriage returns are stripped too.

This doesn't seem to happen on files; if I fopen() a file, fgets() returns the trailing newline on both Quercus and Zend PHP.
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0001143)
ferg
05-16-06 18:52

php/1m0b
 

- Issue History
Date Modified Username Field Change
05-16-06 15:26 koreth New Issue
05-16-06 18:52 ferg Note Added: 0001143
05-16-06 18:52 ferg Assigned To  => ferg
05-16-06 18:52 ferg Status new => closed
05-16-06 18:52 ferg Resolution open => fixed
05-16-06 18:52 ferg Fixed in Version  => 3.0.20


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker