diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2011-11-24 13:04:25 -0800 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2011-11-24 13:05:50 -0800 |
commit | 730f77f2f9ed5030f392d7d8f81fb59ffd34c500 (patch) | |
tree | f0ca1ff16b74d5ff6372caa57e5b2443f4725aec /includes/utility.inc | |
parent | 3b01378ea5e2b2049bcf681eef25008acbb8d3a1 (diff) | |
download | brdo-730f77f2f9ed5030f392d7d8f81fb59ffd34c500.tar.gz brdo-730f77f2f9ed5030f392d7d8f81fb59ffd34c500.tar.bz2 |
Issue #1182296 by BTMash, matason, catch, xjm: Add tests for 7.0->7.x upgrade path.
Diffstat (limited to 'includes/utility.inc')
-rw-r--r-- | includes/utility.inc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/includes/utility.inc b/includes/utility.inc index df6c48fb9..d195bff74 100644 --- a/includes/utility.inc +++ b/includes/utility.inc @@ -46,6 +46,13 @@ function drupal_var_export($var, $prefix = '') { $output = "'" . $var . "'"; } } + elseif (is_object($var) && get_class($var) === 'stdClass') { + // var_export() will export stdClass objects using an undefined + // magic method __set_state() leaving the export broken. This + // workaround avoids this by casting the object as an array for + // export and casting it back to an object when evaluated. + $output .= '(object) ' . drupal_var_export((array) $var, $prefix); + } else { $output = var_export($var, TRUE); } |