Permalink
Browse files

MDL-35001 removed cycle detection from convert_to_array because it ca…

…uses error in data
  • Loading branch information...
1 parent c366bea commit 7116aca6aff7c950e2be05a570d4c5c4003a018f @marinaglancy marinaglancy committed Sep 13, 2012
Showing with 1 addition and 6 deletions.
  1. +1 −6 lib/moodlelib.php
View
@@ -10431,17 +10431,12 @@ function object_property_exists( $obj, $property ) {
*/
function convert_to_array($var) {
$result = array();
- $references = array();
// loop over elements/properties
foreach ($var as $key => $value) {
// recursively convert objects
if (is_object($value) || is_array($value)) {
- // but prevent cycles
- if (!in_array($value, $references)) {
- $result[$key] = convert_to_array($value);
- $references[] = $value;
- }
+ $result[$key] = convert_to_array($value);
} else {
// simple values are untouched
$result[$key] = $value;

0 comments on commit 7116aca

Please sign in to comment.