summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcatch2012-09-05 21:23:38 (GMT)
committercatch2012-09-05 21:23:38 (GMT)
commitfae3c98698ae07118c6fba0ae197ed64ee2006f9 (patch)
tree09d6aaf69a3dc4b84242c6f2da8e82a6b560c2c4
parent3c0da100087b599667af56fff6db5d44a22b5254 (diff)
Issue #1410260 by swentel, mojzis, droplet, pingers: Fixed rss.xml/whatever triggers PHP error.
-rw-r--r--core/modules/node/lib/Drupal/node/Tests/NodeRSSContentTest.php4
-rw-r--r--core/modules/node/node.module3
2 files changed, 7 insertions, 0 deletions
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeRSSContentTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeRSSContentTest.php
index 97b3b25..c0768a2 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeRSSContentTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeRSSContentTest.php
@@ -74,5 +74,9 @@ class NodeRSSContentTest extends NodeTestBase {
$this->drupalGet("node/$node->nid");
$this->assertNoText($rss_only_content, t('Node content designed for RSS doesn\'t appear when viewing node.'));
+ // Check that the node feed page does not try to interpret additional path
+ // components as arguments for node_feed() and returns default content.
+ $this->drupalGet('rss.xml/' . $this->randomName() . '/' . $this->randomName());
+ $this->assertText($rss_only_content, t('Ignore page arguments when delivering rss.xml.'));
}
}
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 7d84b9d..b18b8f4 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -1901,6 +1901,9 @@ function node_menu() {
$items['rss.xml'] = array(
'title' => 'RSS feed',
'page callback' => 'node_feed',
+ // Pass a FALSE and array argument to ensure that additional path components
+ // are not passed to node_feed().
+ 'page arguments' => array(FALSE, array()),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);