kohana-email icon indicating copy to clipboard operation
kohana-email copied to clipboard

wrong array preparation

Open theshock opened this issue 13 years ago • 3 comments

Here: if ( ! in_array($method, array('to', 'cc', 'bcc')))

Because in_array(0, array('to', 'cc', 'bcc')) equals to true It's better to use if ( ! in_array($method, array('to', 'cc', 'bcc'), true)) instead to strict compare

theshock avatar Mar 30 '11 19:03 theshock

Thanks for this. I'm not actively maintaining this repo as I have no use for it currently. If you submit a pull request I'll accept it though.

Out of interest did you actually have a problem with this in real life or is it just something you spotted as being potentially an issue?

banks avatar Mar 31 '11 09:03 banks

Yes, I had while using in such way: Email::send(array('[email protected]', '[email protected]'), $to, $subject, $body); I'll send you pull request in a moment

theshock avatar Mar 31 '11 10:03 theshock

I use it in such way: Email::send(array('[email protected]'), $to, $subject, $body); I had problem, when only one email in $to

theshock avatar Mar 31 '11 10:03 theshock