From a7cb75d37e1f50b28649b704776f510d50995d65 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Fri, 31 Jul 2026 08:19:00 -0400 Subject: [PATCH] streams: tidy the wrapper error log on every open_wrapper return Before the early-return refactor in d75f79e2acf the tidy call sat on the single return path, so it ran whether or not the opener produced a stream. It now runs only when the opener fails, so anything the opener stored while REPORT_ERRORS was masked stays in FG(wrapper_logged_errors) until request shutdown and is replayed by the next failure for the same wrapper. Closes GH-22977 --- main/streams/streams.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/streams/streams.c b/main/streams/streams.c index cb75e322d928..4ee85b773571 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -2141,7 +2141,6 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod php_stream_display_wrapper_name_errors(wrapper_name, context, PHP_STREAM_EC(OpenFailed), "Failed to open stream"); } - php_stream_tidy_wrapper_name_error_log(wrapper_name); goto cleanup; } @@ -2213,6 +2212,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod } cleanup: + php_stream_tidy_wrapper_name_error_log(wrapper_name); pefree(wrapper_name, persistent); cleanup_no_wrapper_name: if (resolved_path) {