|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-12-12 02:50 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 08:00:01 2025 UTC |
Description: ------------ Use mail.h and rfc822.h from the c-client library to create a filter ("FL_RFC822") to allow e-mail addresses to be filtered as RFC822-compliant addresses. This filter would be in addition to the existing FL_EMAIL filter. I have a patch for this, but I don't want to post it here since it's 105 lines. So, I'll send it to derick and sniper via e-mail. The caveat involved in my patch is this: currently, mail.h and rfc822.h must exist in the c-client folder in the system path. This is not exactly efficient or preferrable. It would be best if pecl/filter determines the location of these headers either by the configuration value if PHP was compiled --with-imap or a new config option being added to the configure line for pecl/filter. In either case, the FL_RFC822 filter should probably be disabled if the headers aren't available so that it can be compiled and used anyway without the RFC822 functionality. Reproduce code: --------------- Example of how it works: <?php $email1 = 'John Doe <jdoe@example.org> (comment)'; $email2 = 'Jane Doe <jane@> (comment)'; var_dump(filter_data($email1, FL_RFC822)); var_dump(filter_data($email2, FL_RFC822)); ?> Expected result: ---------------- string(37) "John Doe <jdoe@example.org> (comment)" NULL