Conversation
lib/private/legacy/api.php
Outdated
| if ($format == 'json') { | ||
| return OC_JSON::encode($response); | ||
| if (is_array($response)) { | ||
| array_walk_recursive($response, array('OC_JSON', 'to_string')); |
There was a problem hiding this comment.
What kind of dark hackery is this
server/lib/private/legacy/json.php
Line 173 in fac0a11
There was a problem hiding this comment.
Do not ask question you don't want answered
There was a problem hiding this comment.
It's basically an object which use cast to a string (calling then the __toString() method explicitly). Otherwise the json_encode would fail with an error, that it only can serialize strings, integer, bool and date (the types it knows how to serialize).
lib/private/legacy/eventsource.php
Outdated
|
|
||
| private function encode($data) { | ||
| if (is_array($data)) { | ||
| array_walk_recursive($data, array('OC_JSON', 'to_string')); |
There was a problem hiding this comment.
That's not even a public method
server/lib/private/legacy/json.php
Line 171 in fac0a11
There was a problem hiding this comment.
:/ Need to work on this yes :/
cbb5bb8 to
fae5b1b
Compare
Codecov Report
@@ Coverage Diff @@
## master #8791 +/- ##
============================================
+ Coverage 51.89% 51.93% +0.04%
- Complexity 25278 25279 +1
============================================
Files 1604 1607 +3
Lines 94798 94872 +74
Branches 1377 1377
============================================
+ Hits 49193 49275 +82
+ Misses 45605 45597 -8
|
fae5b1b to
0a004fb
Compare
|
Ready for review again. I dropped the public interfaces that aren't used outside of |
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
0a004fb to
78211a5
Compare
|
@ChristophWurst @skjnldsv Ready for review |
Ref #8375 and #7827