Skip to content

Clear error flag instead of toggling it #6190

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions main/streams/streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -2038,15 +2038,15 @@ PHPAPI php_stream *_php_stream_opendir(const char *path, int options,

if (wrapper && wrapper->wops->dir_opener) {
stream = wrapper->wops->dir_opener(wrapper,
path_to_open, "r", options ^ REPORT_ERRORS, NULL,
path_to_open, "r", options & ~REPORT_ERRORS, NULL,
context STREAMS_REL_CC);

if (stream) {
stream->wrapper = wrapper;
stream->flags |= PHP_STREAM_FLAG_NO_BUFFER | PHP_STREAM_FLAG_IS_DIR;
}
} else if (wrapper) {
php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS, "not implemented");
php_stream_wrapper_log_error(wrapper, options & ~REPORT_ERRORS, "not implemented");
}
if (stream == NULL && (options & REPORT_ERRORS)) {
php_stream_display_wrapper_errors(wrapper, path, "Failed to open directory");
Expand Down Expand Up @@ -2115,18 +2115,18 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod

if (wrapper) {
if (!wrapper->wops->stream_opener) {
php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS,
php_stream_wrapper_log_error(wrapper, options & ~REPORT_ERRORS,
"wrapper does not support stream open");
} else {
stream = wrapper->wops->stream_opener(wrapper,
path_to_open, mode, options ^ REPORT_ERRORS,
path_to_open, mode, options & ~REPORT_ERRORS,
opened_path, context STREAMS_REL_CC);
}

/* if the caller asked for a persistent stream but the wrapper did not
* return one, force an error here */
if (stream && (options & STREAM_OPEN_PERSISTENT) && !stream->is_persistent) {
php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS,
php_stream_wrapper_log_error(wrapper, options & ~REPORT_ERRORS,
"wrapper does not support persistent streams");
php_stream_close(stream);
stream = NULL;
Expand Down Expand Up @@ -2183,7 +2183,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod
tmp);
efree(tmp);

options ^= REPORT_ERRORS;
options &= ~REPORT_ERRORS;
}
}
}
Expand Down