fuel / email

Fuel PHP Framework - Fuel v1.x Email library
60 stars 38 forks source link

Fixed incorrect trimming of cid #28

Closed floorish closed 12 years ago

floorish commented 12 years ago

The attach functions incorrectly trim the $cid

'cid:'.ltrim($cid, 'cid:')

ltrim also removes 'c', 'ci', 'cid' or 'cid:' from the $cid md5, i.e.:

$cid = 'ce2e352a843c68a955a53b882f6567da';
$cid = 'cid:'.ltrim($cid, 'cid:');   //outputs "cid:e2e352a843c68a955a53b882f6567da" (missing c)

So the cid in the body of the message is not equal to the cid added to the attached file, which gives missing inline attachments.

WanWizard commented 12 years ago

correct, trim()'s second parameter is not a string, its a character list. Well spotted!