ext/standard/mail: Various refactorings (part 2)#20791
Draft
Girgias wants to merge 7 commits intophp:masterfrom
Draft
ext/standard/mail: Various refactorings (part 2)#20791Girgias wants to merge 7 commits intophp:masterfrom
Girgias wants to merge 7 commits intophp:masterfrom
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
requested changes
Dec 28, 2025
Member
ndossche
left a comment
There was a problem hiding this comment.
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.
|
|
||
| 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); |
Member
There was a problem hiding this comment.
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) { |
Member
There was a problem hiding this comment.
I'm not sure what the implications are of allowing NULs now. I suppose that won't work properly anyway?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.