Skip to content

Conversation

@Girgias
Copy link
Member

@Girgias Girgias commented Dec 26, 2025

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.

PHP_RSHUTDOWN_FUNCTION(user_filters);
PHP_RSHUTDOWN_FUNCTION(browscap);

/* Left for BC (not binary safe!) */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment still accurate now?


if (PG(mail_x_header)) {
const char *tmp = zend_get_executed_filename();
const zend_string *tmp = zend_get_executed_filename_ex();
Copy link
Member

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

}


#define MAIL_RET(val) \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this code motion is important/useful.

while (len < value->len) {
if (*(value->val+len) == '\r') {
if (*(value->val+len+1) != '\n') {
for (size_t len = 0; len < ZSTR_LEN(value); len++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is wrong.
Now you always increment len, even if the "continue" is hit. So the following code block:

len += 3;
continue;

will now increment by 4 instead of 3.

. _php_error_log() now has a formal return type of zend_result.
. _php_error_log() now accepts zend_string* values instead of char*.
. _php_error_log_ex() has been removed.
. php_mail()'s extra_cmd parameter is now a zend_string*.
Copy link
Member

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 this change accomplishes concretely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants