Page 1 of 1

One Bug Report and One Bug Fix?

Posted: Sun Oct 07, 2007 3:43 pm
by afwt
Bug Fix:

Swift_Address::build()

changed line:

Code: Select all

return '"' . addslashes($this->name) . '" <' . $this->address . '>';
Reason: names can contain quotes, so they should be escaped here (and encapsulated with quotes) prior to use in headers.

By the way, I am curious about this function: how come name is not built at all if SMTP is used? Would anyone be so kind to tell me why that IF is there? :-(

Bug Report:

I have noticed a strange behavior: when you init a Decorator plugin, then Embedder, an error occurres on Decorator's sendPerformed (actually, it's recursiveRestore) simply because Embedder beforeSendPerformed is adding attachments after Decorator's bSP. :-(
I was going through the code and tracked it down to attaching embedded images, when it runs $this->postAttachFixStructure(); in Swift_Message::attach()
That messes up Decorator's (replacement's) $store property so it can't revert it back anymore.

When you initialize embedder before decorator, and it does the attachments first, then everything is just fine. Except for the fact that avatars ({username}.gif decoration replacement) can't be embedded cuz decorator kicks in after embedder... :-(

I can provide a sample code (taken out of the manuals), I replicated it on test script too.

Suggestion:

I noticed that PHP4 version doesn't utilize iterator in Swift_BatchMailer::send(). I added it so I can use it myself (powerful stuff, great article, btw!), maybe it should be added to the distro too.... ;-)

Posted: Sun Oct 07, 2007 3:48 pm
by afwt
addon to bug report:

The actual error is thrown on Decorator::recursiveRestore() ( called by sendPerformed() ) on line $mime->setData($store["body"]); ($mime is null, not a message part).