-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
Return empty string for empty xml tag in modRestService #14305
Conversation
How to test this PRCreate file
Check empty fields before and after code changes. |
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.
Tested, works as planned.
Before:
array(5) {
["title"]=>
string(5) "Title"
["empty"]=>
array(0) {
}
["name"]=>
string(4) "John"
["children"]=>
array(1) {
["child"]=>
array(2) {
[0]=>
array(1) {
["title"]=>
string(5) "child"
}
[1]=>
array(1) {
["title"]=>
array(0) {
}
}
}
}
["body"]=>
string(4) "Text"
}
After:
array(5) {
["title"]=>
string(5) "Title"
["empty"]=>
string(0) ""
["name"]=>
string(4) "John"
["children"]=>
array(1) {
["child"]=>
array(2) {
[0]=>
array(1) {
["title"]=>
string(5) "child"
}
[1]=>
array(1) {
["title"]=>
string(0) ""
}
}
}
["body"]=>
string(4) "Text"
}
Hmm, how can you tell from the raw XML if an entry is supposed to be a string or an array? With the example for testing (thanks for that!) it's obvious that you want |
Ahh this is for handling incoming requests, I thought it was for processing responses. My bad. |
* upstream/pr/14305: Return empty string for empty xml tag in modRestService
What does it do?
Check output for empty
array
. If it is empty, return emptystring
.Why is it needed?
When modRestService parse XML to array empty XML-tags returning as empty
array
.Related issue(s)/PR(s)
#13132