-
Notifications
You must be signed in to change notification settings - Fork 8k
ext/standard/mail: Various refactorings (part 2) #20791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This prevents some strlen() recomputation
In preparation for future refactorings
This prevents a strlen() reconputation
All other values of the enum are checked
8799e62 to
f4a47fd
Compare
ndossche
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not reviewing this further. I don't like all the code motion; I don't think this improves readability enough to justify the complexity and risks of refactoring.
ext/standard/php_mail.h
Outdated
|
|
||
| PHPAPI zend_string *php_mail_build_headers(const HashTable *headers); | ||
| PHPAPI extern bool php_mail(const char *to, const char *subject, const char *message, const char *headers, const zend_string *extra_cmd); | ||
| PHPAPI extern bool php_mail(const char *to, const char *subject, const zend_string *message, const char *headers, const zend_string *extra_cmd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is less flexible than having a char pointer, as third party extensions are now also forced to wrap their string in a zend_string first.
| } | ||
|
|
||
| while(*hdr) { | ||
| while (hdr < end) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what the implications are of allowing NULs now. I suppose that won't work properly anyway?
Follow-up from #20782
Commits should be reviewed in order
Part 2 of various refactoring relating to php_mail(), the main objective is to get rid of various
strlen()recomputations when we already know the length of the strings, and various clean-ups.There will be a part 3 when #20789 and this gets merged to propagate
zend_strings to the win32TSendMail()function to remove some morestrlen()calls for known lengths.