Commit 745b5b03 authored by Dries's avatar Dries
Browse files

- Patch #618938 by pwolanin: fixed Drupal version is not being available until...

- Patch #618938 by pwolanin: fixed Drupal version is not being available until the end of bootstrap.
parent 1b834201
......@@ -6,6 +6,36 @@
* Functions that need to be loaded on every Drupal request.
*/
/**
* The current system version.
*/
define('VERSION', '7.0-dev');
/**
* Core API compatibility.
*/
define('DRUPAL_CORE_COMPATIBILITY', '7.x');
/**
* Minimum supported version of PHP.
*/
define('DRUPAL_MINIMUM_PHP', '5.2.0');
/**
* Minimum recommended value of PHP memory_limit.
*/
define('DRUPAL_MINIMUM_PHP_MEMORY_LIMIT', '16M');
/**
* Minimum supported version of MySQL, if it is used.
*/
define('DRUPAL_MINIMUM_MYSQL', '5.0');
/**
* Minimum supported version of PostgreSQL, if it is used.
*/
define('DRUPAL_MINIMUM_PGSQL', '8.3');
/**
* Indicates that the item should never be removed unless explicitly told to
* using cache_clear_all() with a cache ID.
......
......@@ -1993,7 +1993,9 @@ function node_block_view($delta = '') {
* generated with passing an empty array, if no items are to be added
* to the feed.
* @param $channel
* An associative array containing title, link, description and other keys.
* An associative array containing title, link, description and other keys,
* to be parsed by format_rss_channel() and format_xml_elements().
* A list of channel elements can be found at the @link http://cyber.law.harvard.edu/rss/rss.html RSS 2.0 Specification. @endlink
* The link should be an absolute URL.
*/
function node_feed($nids = FALSE, $channel = array()) {
......@@ -2053,11 +2055,12 @@ function node_feed($nids = FALSE, $channel = array()) {
'description' => variable_get('feed_description', ''),
'language' => $language->language
);
$channel_extras = array_diff_key($channel, $channel_defaults);
$channel = array_merge($channel_defaults, $channel);
$output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
$output .= "<rss version=\"" . $channel["version"] . "\" xml:base=\"" . $base_url . "\" " . drupal_attributes($namespaces) . ">\n";
$output .= format_rss_channel($channel['title'], $channel['link'], $channel['description'], $items, $channel['language']);
$output .= format_rss_channel($channel['title'], $channel['link'], $channel['description'], $items, $channel['language'], $channel_extras);
$output .= "</rss>\n";
drupal_add_http_header('Content-Type', 'application/rss+xml; charset=utf-8');
......
......@@ -1048,3 +1048,27 @@ class NodeTitleTestCase extends DrupalWebTestCase {
$this->assertEqual(current($this->xpath($xpath)), $node->title[FIELD_LANGUAGE_NONE][0]['value'], 'Node preview title is equal to node title.', 'Node');
}
}
/**
* Test the node_feed() functionality
*/
class NodeFeedTestCase extends DrupalWebTestCase {
public static function getInfo() {
return array(
'name' => 'Node feed',
'description' => 'Ensures that node_feed() functions correctly.',
'group' => 'Node',
);
}
/**
* Ensure that node_feed accepts and prints extra channel elements.
*/
function testNodeFeedExtraChannelElements() {
ob_start();
node_feed(array(), array('copyright' => 'Drupal is a registered trademark of Dries Buytaert.'));
$output = ob_get_clean();
$this->assertTrue(strpos($output, '<copyright>Drupal is a registered trademark of Dries Buytaert.</copyright>') !== FALSE);
}
}
......@@ -6,36 +6,6 @@
* Configuration system that lets administrators modify the workings of the site.
*/
/**
* The current system version.
*/
define('VERSION', '7.0-dev');
/**
* Core API compatibility.
*/
define('DRUPAL_CORE_COMPATIBILITY', '7.x');
/**
* Minimum supported version of PHP.
*/
define('DRUPAL_MINIMUM_PHP', '5.2.0');
/**
* Minimum recommended value of PHP memory_limit.
*/
define('DRUPAL_MINIMUM_PHP_MEMORY_LIMIT', '16M');
/**
* Minimum supported version of MySQL, if it is used.
*/
define('DRUPAL_MINIMUM_MYSQL', '5.0');
/**
* Minimum supported version of PostgreSQL, if it is used.
*/
define('DRUPAL_MINIMUM_PGSQL', '8.3');
/**
* Maximum age of temporary files in seconds.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment