1. Sending in a blank string for content type passes it through into the header, producing for example "Content-Type: ; charset=iso-8859-1". It might be nice to have a check for this.
2. Setting a null content type appears to make the constructor blow up. I wouldn't bet my life on it but I think that's what's going on here:
My offending code, written in hopes of squashing the blank charset in header behavior above by replacing any blank strings with null:
Code: Select all
$message =& new Swift_Message($subject, $body, ($content_type ? $content_type : null), ($content_transfer_encoding ? $content_transfer_encoding : null));Code: Select all
Swift_Message_MimeException: Cannot set attribute 'charset' for header 'Content-Type' as the header does not exist. Consider using Swift_Message_Headers->has() to check.
Log Information
++ Log level changed to 3
in /Library/WebServer/snip/inc/swift/Swift/Message/Headers.php on line 279
Call Stack
# Time Memory Function Location
1 0.0064 149232 {main}( ) ../imap_slurp.php:0
2 11.1301 1706080 Swift_Message->__construct( ) ../imap_slurp.php:331
3 11.1379 1972792 Swift_Message->setCharset( ) ../Message.php:92
4 11.1379 1973088 Swift_Message_Headers->setAttribute( ) ../Message.php:385
Variables in local scope (#4)
$name = string 'charset' (length=7)
$value = null
$lheader = string 'content-type' (length=12)
$header = string 'Content-Type' (length=12)