Skip to content

standard: various nit and refactorings for standard stream wrappers - #22875

Open
Girgias wants to merge 4 commits into
php:masterfrom
Girgias:2026-07-std-stream-wrapper-nits
Open

standard: various nit and refactorings for standard stream wrappers#22875
Girgias wants to merge 4 commits into
php:masterfrom
Girgias:2026-07-std-stream-wrapper-nits

Conversation

@Girgias

@Girgias Girgias commented Jul 23, 2026

Copy link
Copy Markdown
Member

No description provided.

@Girgias
Girgias marked this pull request as ready for review July 25, 2026 10:36
@Girgias
Girgias requested a review from bukka as a code owner July 25, 2026 10:36
@Girgias
Girgias requested a review from devnexen July 28, 2026 08:39
}
/* check for control characters in login, password & path */
if (strncasecmp(new_path, "http://", sizeof("http://") - 1) || strncasecmp(new_path, "https://", sizeof("https://") - 1)) {
if (zend_string_starts_with_literal_ci(new_path, "http://") || zend_string_starts_with_literal_ci(new_path, "https://")) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it seems the old condition was always true regardless ? I would either drop the "migrated" version of it or

if (!zend_string_starts_with_literal_ci(new_path, "http://") && !zend_string_starts_with_literal_ci(new_path, "https://"))
```. wdyt ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm... not even sure what the semantics are. Reading the rest of the code it does seem to me that it expects the path to start with an HTTP protocol schema....

As we are passing new_path to php_stream_url_wrap_http_ex

php_stream_wrapper_log_warn(wrapper, context, options, InvalidUrl, \
"Invalid redirect URL! %s", new_path); \
"Invalid redirect URL! %s", ZSTR_VAL(new_path)); \
efree(new_path); \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If I follow well, this needs an update.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It does indeed.

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