[imp] 2 x \n in new messages

Bjorn Swift bjorn@swift.st
Fri, 25 Jan 2002 00:43:08 -0000


Hey

> Haven't touched this code for a while but if I remember right, this was
> necessary.
>

Necessary? Couldn't one add a function that checks for two newline
characters at the end of the $msg string - and remove them if their found?

I'm sure there is a better way but something like this might work;

$msg = "Test script\n\n";
$nl = "\n\n";
$msgwithoutnl = strlen($msg) - strlen($nl);

if (strrpos($msg, $nl) == $msgwithoutnl+1)
 $msg = substr($msg, 0 , $msgwithoutnl);

$nl could then be replaced with \r\n\r\n it that is used ...

> Not the HEAD tree but the RELENG branches. Check out
> http://horde.org/source for details.
>

Thanks, downloading now ;)

Bjorn Swift