[dev] Re: [cvs] commit: imp compose.php
Jon Parise
jon@csh.rit.edu
Fri, 3 Nov 2000 16:49:24 -0500
On Fri, Sep 22, 2000 at 08:54:15AM -0500, Brent J. Nordquist wrote:
> > This left me with an empty To: field and some addresses in the Cc:
> > field. That causes an error on send.
>
> As a side note, do you mean an IMP error? Shouldn't an all-Cc: message be
> legal? It works in pine, for example... I can't think of a reason why it
> should be prevented.
What do people think of this patch?
Index: compose.php
===================================================================
RCS file: /cvs/horde/imp/compose.php,v
retrieving revision 2.215
diff -u -r2.215 compose.php
--- compose.php 2000/11/03 21:35:49 2.215
+++ compose.php 2000/11/03 21:48:52
@@ -602,6 +602,15 @@
if (isset($attachments_type) && !is_array($attachments_type)) {
$attachments = array($attachments_type);
}
+
+ /*
+ * If the To: field is blank but the Cc: field isn't, copy the Cc:
+ * values to the To: field and set the Cc: field to an empty string.
+ */
+ if (empty($to) && !empty($cc)) {
+ $to = $cc;
+ $cc = '';
+ }
if ($to && isset($message)) {
--
Jon Parise (jon@csh.rit.edu) . Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/ : Computer Science House Member