-
Notifications
You must be signed in to change notification settings - Fork 8k
ext/standard/mail: Various refactorings (part 1) #20782
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
ext/standard/mail.c
Outdated
|
|
||
| if (PG(mail_x_header)) { | ||
| const char *tmp = zend_get_executed_filename(); | ||
| const zend_string *tmp = zend_get_executed_filename_ex(); |
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.
This is not equivalent because zend_get_executed_filename cannot return NULL while zend_get_executed_filename_ex can
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.
Please revert this change, the extra complexity does not seem worth it. I doubt you're gonna feel the strlen() call here anyway. Furthermore I don't like to duplicate some of that logic here.
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.
Done :)
49fc148 to
b68179a
Compare
ext/standard/mail.c
Outdated
|
|
||
| if (PG(mail_x_header)) { | ||
| const char *tmp = zend_get_executed_filename(); | ||
| const zend_string *tmp = zend_get_executed_filename_ex(); |
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.
Please revert this change, the extra complexity does not seem worth it. I doubt you're gonna feel the strlen() call here anyway. Furthermore I don't like to duplicate some of that logic here.
In preparation for php_mail() refactoring
Fix incorrect return type Use zend_string macros
The branching logic is already defined in the function
Change paremeter type to be zend_string* rather than assuming the zval IS_STRING Use zend_string macros Add const qualifier
b68179a to
2290aef
Compare
Commits should be reviewed in order
Part 1 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.