Download & Extend

$element['namespace'] is sometimes and array not a single value.

Project:Comment RSS
Version:5.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

As the title says, $element['namespace'] is sometimes and array not a single value. Which means when you array_merge on line 198 and then implode on line 201 the result is :

xmlns:dc="http://purl.org/dc/elements/1.1/" Array

This is due to the code on line 115-> 121

<?php

     
foreach ($extra as $element) {
        if (
$element['namespace']) {
         
$namespaces[] = $element['namespace'];
        }
      }
?>

Should be (assuming it may be an array or single value) :

<?php

     
foreach ($extra as $element) {
        if(
is_array($element['namespace'])) {
          foreach (
$element['namespace'] as $elements_namespace) {
           
$namespaces[] = $elements_namespace;
          }
        }
        else if (
$element['namespace']) {
         
$namespaces[] = $element['namespace'];
        }
      }
?>

a_c_m

Comments

#1

Status:needs review» postponed (maintainer needs more info)

When is it a single value and not an array? I believe this might be an issue in another contributed module. I did not stumble on this issue with Drupal core itself.

#2

Status:postponed (maintainer needs more info)» fixed

This was effectively dead code. The node feed called out to modules as if we are displaying a node in a feed, but we do not (before, the module did include the node as the first item in the feed, but the previous maintainer removed this functionality).

Code in 5.x-1.x and 6.x-1.x only added namespace items to the comment rss feed, but did not add anything from the node. Removed that dead functionality in new releases on 5.x-2.0 and 6.x-2.0. These are the new supported branches, with lots of other improvements.

#3

Status:fixed» closed (fixed)

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