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().
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to