Ticket #175: namespace.diff

File namespace.diff, 1.2 kB (added by sdcosta, 4 years ago)

patch from magpie bug tracker 1200899

  • extlib/rss_parse.inc

     </html>
     
    350350        if ( $this->current_namespace )  
    351351        { 
    352352            if ( $this->initem ) { 
     353                $real_element = ""; 
     354 
     355                $element_tree = explode("_", $el); 
     356                $real_element =& $this->current_item[ $this->current_namespace ]; 
     357 
     358                foreach ($element_tree as $tree_element) { 
     359                    if (!is_array($real_element)) { 
     360                        $real_element = array(); 
     361                    } 
     362 
     363                    $real_element =& $real_element[$tree_element]; 
     364                } 
     365 
    353366                $this->concat( 
    354                     $this->current_item[ $this->current_namespace ][ $el ], $text); 
     367                    $real_element, $text); 
    355368            } 
    356369            elseif ($this->inchannel) { 
    357370                $this->concat( 
     
    367380            } 
    368381        } 
    369382        else { 
    370             if ( $this->initem ) { 
     383            if ( $this->initem && !is_array($this->current_item[ $el ])) { 
    371384                $this->concat( 
    372385                    $this->current_item[ $el ], $text); 
    373386            }