Changeset 85762 in spip-zone


Ignore:
Timestamp:
Oct 31, 2014, 1:17:28 PM (5 years ago)
Author:
severo@…
Message:

Report de c21764 - fixes #3325

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/iterateurs/iterateur/data.php

    r70239 r85762  
    420420 */
    421421function inc_xml_to_array_dist($u) {
    422         return @ObjectToArray(new SimpleXmlIterator($u));
     422        return @XMLObjectToArray(new SimpleXmlIterator($u));
     423}
     424/**
     425 *
     426 * object -> tableau
     427 *
     428 * @param  object $object The object to convert
     429 * @return array
     430 *
     431 */
     432function inc_object_to_array( $object ) {
     433        if( !is_object( $object ) && !is_array( $object ) ) {
     434                return $object;
     435        }
     436        if( is_object( $object ) ) {
     437                $object = get_object_vars( $object );
     438        }
     439        return array_map( 'inc_object_to_array', $object );
    423440}
    424441
     
    437454                return false;
    438455        }
    439         return (array) $w;
     456        return inc_object_to_array($w);
    440457}
    441458
     
    570587 * @return array|bool
    571588 */
    572 function ObjectToArray($object){
     589function XMLObjectToArray($object){
    573590        $xml_array = array();
    574591        for( $object->rewind(); $object->valid(); $object->next() ) {
Note: See TracChangeset for help on using the changeset viewer.