#24727 [NEW]: Net::NNTP getBody() breaks binary data with trim()

From: Date: Sun, 20 Jul 2003 15:57:28 +0000
Subject: #24727 [NEW]: Net::NNTP getBody() breaks binary data with trim()
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-18466@lists.php.net to get a copy of this message
From: meebey@php.net Operating system: Debian PHP version: Irrelevant PHP Bug Type: PEAR related Bug description: Net::NNTP getBody() breaks binary data with trim() Description: ------------ getBody() of the NNTP class does a trim() for each time it reads data from the server, this breaks binary data. It should just cut the \r\n with a str_replace or something similiar, the trim() function removes chars which can be part of binary data. Here the patch: --- NNTP.php 2003-07-20 17:55:30.000000000 +0200 +++ NNTPpatched.php 2003-07-20 17:55:52.000000000 +0200 @@ -377,7 +377,7 @@ $body = null; while (!feof($this->fp)) { - $line = trim(fgets($this->fp, 256)); + $line = str_replace("\r\n", '', fgets($this->fp, 256)); if ($line == '.') { break; -- Edit bug report at http://bugs.php.net/?id=24727&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24727&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24727&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=24727&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24727&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24727&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24727&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24727&r=support Expected behavior: http://bugs.php.net/fix.php?id=24727&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24727&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24727&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24727&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24727&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24727&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24727&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24727&r=gnused

« previous php.pear.dev (#18466) next »