ext/soap: Windows handles query strings differently
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C
- Sterne
- 40.4k
- Forks
- 8.1k
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 96
Beschreibung
If I'm right, that would also happen on other OSs if ext/soap is built as shared library.
Nope, has nothing to do with shared libs – Windows specific issue.
The problem is that SoapServer expects "wsdl" as query string to deliver the WSDL. However, if a query string doesn't contain an equals sign, command line options are ignored on Windows. So either hack-around by making SoapServer more deliberate:
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.
Originally posted by @cmb69 in https://github.com/php/php-src/issues/17432#issuecomment-2589593847
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne in ext/soap/soap.c bei SoapServer::handle und prüfe, wie sich das Verhalten der Windows-CGI-Abfragezeichenfolge auf die "wsdl"-Anfrage auswirkt. Vergleiche die vorgeschlagene Änderung zur Verarbeitung in einer Datei mit dem im Issue beschriebenen alternativen CGI-Testansatz. Erledigt ist die Aufgabe, wenn Windows die WSDL für die betroffene Abfragezeichenfolge ausliefert und das Verhalten durch geeignete Regressionstests abgedeckt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, php
- Bereich
- api, backend, operating-systems, testing-qa
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100