#6. #1423460: [META] List of bugs and typos in Drupal core found by Spleshka

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);
  }

Comments

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Yup! Let's do this.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x and 8.x. Thanks.

tim.plunkett’s picture

Title: drupal_var_export() is a concatination to undefined variable $output » drupal_var_export() is a concatenation to undefined variable $output

I can't fix the commit message, but I can fix the issue title!

Automatically closed -- issue fixed for 2 weeks with no activity.