Skip to content

Commit

Permalink
Fix binary safety (bug #24727)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/Net_NNTP/trunk@136523 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
heino committed Aug 3, 2003
1 parent 4581df7 commit ad210e9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions NNTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function getArticle($article)
}
$post = null;
while (!feof($this->fp)) {
$line = trim(fgets($this->fp, 256));
$line = rtrim(fgets($this->fp, 256), "\r\n");

if ($line == ".") {
break;
Expand Down Expand Up @@ -260,7 +260,7 @@ function post($subject, $newsgroup, $from, $body, $aditional = "")
fputs($this->fp, "POST\n");

/* The servers' response */
$response = trim(fgets($this->fp, 128));
$response = rtrim(fgets($this->fp, 128), "\r\n");

fputs($this->fp, "From: $from\n");
fputs($this->fp, "Newsgroups: $newsgroup\n");
Expand All @@ -270,7 +270,7 @@ function post($subject, $newsgroup, $from, $body, $aditional = "")
fputs($this->fp, "\n$body\n.\n");

/* The servers' response */
$response = trim(fgets($this->fp, 128));
$response = rtrim(fgets($this->fp, 128), "\r\n");

return $response;
}
Expand All @@ -295,7 +295,7 @@ function getHeaders($article)

$headers = '';
while(!feof($this->fp)) {
$line = trim(fgets($this->fp, 256));
$line = rtrim(fgets($this->fp, 256), "\r\n");

if ($line == '.') {
break;
Expand Down Expand Up @@ -379,7 +379,7 @@ function getBody($article)

$body = null;
while (!feof($this->fp)) {
$line = trim(fgets($this->fp, 256));
$line = rtrim(fgets($this->fp, 256), "\r\n");

if ($line == '.') {
break;
Expand Down Expand Up @@ -408,7 +408,7 @@ function _getData()
{
$body = array();
while(!feof($this->fp)) {
$line = trim(fgets($this->fp, 256));
$line = rtrim(fgets($this->fp, 256), "\r\n");
if ($line == '.') {
break;
} else {
Expand Down

0 comments on commit ad210e9

Please sign in to comment.