Bug #21236 [Com]: Line with starting dot is not dot stuffed

From: Date: Sat, 19 Aug 2017 15:50:58 +0000
Subject: Bug #21236 [Com]: Line with starting dot is not dot stuffed
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to [email protected] to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=21236&edit=1

 ID:               21236
 Comment by:       mesa57 at hotmail dot com
 Reported By:      mesa57 at hotmail dot com
 Summary:          Line with starting dot is not dot stuffed
 Status:           Analyzed
 Type:             Bug
 Package:          Net_NNTP
 Operating System: Win 7
 Package Version:  1.5.1
 PHP Version:      5.6.31
 Roadmap Versions: 
 New Comment:

We had (and some USP providers) had only problems with article body's
where dot stuffing was not done.
But I agree when reading RFC 3877 it should also be applied to headers
as wel.
Btw. https://github.com/pear/Net_NNTP does not allow
to open issues.


Previous Comments:
------------------------------------------------------------------------

[2017-08-19 10:58:54] heino

By the way, please use GitHub instead...

------------------------------------------------------------------------

[2017-08-19 10:57:44] heino

-Status: Open
+Status: Analyzed
And this would be solved by changing the following lines in
_sendArticle()

@fwrite($this->_socket, $article);
@fwrite($this->_socket, $header);
@fwrite($this->_socket, $body);

into something line

@fwrite($this->_socket, preg_replace("|\n\.|", "\n.." , $article));
@fwrite($this->_socket, preg_replace("|\n\.|", "\n.." , $header));
@fwrite($this->_socket, preg_replace("|\n\.|", "\n.." , $body));

?

------------------------------------------------------------------------

[2017-08-19 10:06:28] mesa57

Description:
------------
According to 
https://tools.ietf.org/html/rfc3977#page-8
when a body is posted, an newline which starts with a dot should be
dot-stuffed (e.g. the dot should be doubled).
Net_NNTP does change the double dots at the beginning of a line when
reading the body, but does not add the extra dot when posting.

------------------------------------------------------------------------


-- 
Edit this bug report at https://pear.php.net/bugs/bug.php?id=21236&edit=1


Thread (1 message)

« previous php.pear.bugs (#11398) next »