-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
ext/soap: Don't call readfile() userland function #17432
Conversation
We can perform the operation directly, moreover there is no risk of a user disabling the readfile function and defining their own messing up what we are doing.
75a8bfe
to
6eb1155
Compare
ext/soap/tests/SoapServer/handle_non_existing_WSDL_from_get_query_redefine_readfile.phpt
Outdated
Show resolved
Hide resolved
ext/soap/tests/SoapServer/handle_non_existing_WSDL_from_get_query_disable_readfile.phpt
Outdated
Show resolved
Hide resolved
ext/soap/tests/SoapServer/handle_non_existing_WSDL_from_get_query.phpt
Outdated
Show resolved
Hide resolved
ext/soap/soap.c
Outdated
ZVAL_STRING(¶m, service->sdl->source); | ||
ZVAL_STRING(&readfile, "readfile"); | ||
if (call_user_function(EG(function_table), NULL, &readfile, &readfile_ret, 1, ¶m ) == FAILURE) { | ||
php_stream *stream = php_stream_open_wrapper_ex(service->sdl->source, "rb", REPORT_ERRORS, NULL, /* context */ NULL); |
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 use the default stream context
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.
Pleas also fix WIN64 tests failures.
@cmb69 I don't really understand why it seems like the SOAP extension is not being loaded in the new soap test |
I think the problem is that |
Right, this is slightly annoying :/ I guess the easy fix is to just skip those tests on Windows, but we should open an issue to track this IMHO. |
Nope, has nothing to do with shared libs – Windows specific issue. The problem is that ext/soap/soap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 48a7fc8885..d7dfc4ecd5 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -1297,7 +1297,8 @@ PHP_METHOD(SoapServer, handle)
if (SG(request_info).request_method &&
strcmp(SG(request_info).request_method, "GET") == 0 &&
SG(request_info).query_string &&
- stricmp(SG(request_info).query_string, "wsdl") == 0) {
+ (stricmp(SG(request_info).query_string, "wsdl") == 0 ||
+ stricmp(SG(request_info).query_string, "wsdl=") == 0)) {
if (service->sdl) {
/* or apply a proper fix for the tests, namely to spawn a php-cgi process with the command line options, and then send a CGI request and verify the response. Certainly possible, but I'm not sure it's worth the effort. |
I've made a new issue to track the WSDL query issue on Windows, and have the new tests just skip on Windows for now. |
ext/soap/tests/SoapServer/handle_non_existing_WSDL_from_get_query.phpt
Outdated
Show resolved
Hide resolved
Makes sense to me, especially since we now have a proper explanation why the test is skipped on Windows. |
We can perform the operation directly, moreover there is no risk of a user disabling the readfile function and defining their own messing up what we are doing.