I have some code I got somewhere as well.... I'll go dig it up
Sam D
On Jan 16, 2008 8:14 PM, squidliberty <[EMAIL PROTECTED]> wrote:
>
> Well, I can't move to 1.2 on production sites, but I did take a look
> at its API and got some ideas. Here is what I added to my PHPMailer
> component, in case anyone else needs something similar.
>
>
> function cleanArray(&$toClean) {
> $sanitize = new Sanitize();
> $header_bits = array('/%0a/i', '/%0d/i', '/Content-Type\:/i', '/
> Content\-Transfer\-Encoding\:/i', '/charset\=/i', '/mime-version\:/i',
> '/multipart\/mixed/i', '/bcc\:.*/i','/to\:.*/i','/cc\:.*/i', '/from\:/
> i', '/\\r/i', '/\\n/i');
>
> if (is_array($toClean)) {
> while (list($k, $v) = each($toClean)) {
> if (is_array($toClean[$k]))
> $this->cleanArray($toClean[$k]);
> else {
> $v = $sanitize->cleanValue($v);
> $toClean[$k] = preg_replace($header_bits, '',
> $v);
> }
> }
> } else return null;
> }
>
>
> Now, I can just use $this->Email->cleanArray() instead of $sanitize-
> >cleanArray().
>
> >
>
--
(the old fart) the advice is free, the lack of crankiness will cost you
- its a fine line between a real question and an idiot
http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---