drupal/drupal.patch

Tue, 28 Aug 2012 18:28:45 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:28:45 +0200
changeset 529
7d4d11d301d6
child 530
5cd084e0397a
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

michael@529 1 Fix Reverse Proxy Support:
michael@529 2 http://drupal.org/node/244593
michael@529 3 http://drupal.org/files/issues/drupal_80.patch
michael@529 4
michael@529 5 Index: includes/bootstrap.inc
michael@529 6 --- includes/bootstrap.inc.orig 2008-02-11 15:36:21 +0100
michael@529 7 +++ includes/bootstrap.inc 2008-04-09 20:47:49 +0200
michael@529 8 @@ -272,6 +272,7 @@
michael@529 9 */
michael@529 10 function conf_init() {
michael@529 11 global $base_url, $base_path, $base_root;
michael@529 12 + global $base_url_local;
michael@529 13
michael@529 14 // Export the following settings.php variables to the global namespace
michael@529 15 global $db_url, $db_prefix, $cookie_domain, $conf, $installed_profile, $update_free_access;
michael@529 16 @@ -723,9 +724,22 @@
michael@529 17 * generate an equivalent using other environment variables.
michael@529 18 */
michael@529 19 function request_uri() {
michael@529 20 + global $base_url;
michael@529 21 + global $base_url_local;
michael@529 22
michael@529 23 if (isset($_SERVER['REQUEST_URI'])) {
michael@529 24 $uri = $_SERVER['REQUEST_URI'];
michael@529 25 + if (isset($base_url) && isset($base_url_local)) {
michael@529 26 + $parts = parse_url($base_url_local);
michael@529 27 + if ( strlen($uri) >= strlen($base_url_local)
michael@529 28 + && substr($uri, 0, strlen($base_url_local)) == $base_url_local) {
michael@529 29 + $uri = $base_url . substr($uri, strlen($base_url_local));
michael@529 30 + }
michael@529 31 + elseif ( strlen($uri) >= strlen($parts["path"])
michael@529 32 + && substr($uri, 0, strlen($parts["path"])) == $parts["path"]) {
michael@529 33 + $uri = $base_url . substr($uri, strlen($parts["path"]));
michael@529 34 + }
michael@529 35 + }
michael@529 36 }
michael@529 37 else {
michael@529 38 if (isset($_SERVER['argv'])) {
michael@529 39 @@ -792,6 +806,7 @@
michael@529 40 }
michael@529 41 }
michael@529 42 // Prevent multiple slashes to avoid cross site requests via the FAPI.
michael@529 43 + if (substr($uri, 0, 1) == "/")
michael@529 44 $uri = '/'. ltrim($uri, '/');
michael@529 45
michael@529 46 return $uri;
michael@529 47 Index: sites/default/default.settings.php
michael@529 48 --- sites/default/default.settings.php.orig 2007-12-20 10:35:10 +0100
michael@529 49 +++ sites/default/default.settings.php 2008-04-09 20:47:32 +0200
michael@529 50 @@ -126,6 +126,24 @@
michael@529 51 # $base_url = 'http://www.example.com'; // NO trailing slash!
michael@529 52
michael@529 53 /**
michael@529 54 + * Local Base URL (optional).
michael@529 55 + *
michael@529 56 + * If you are running Drupal behind a reverse proxy, $base_url (see above)
michael@529 57 + * usually points to the URL of the reverse proxy. Drupal uses this for
michael@529 58 + * all sorts of external URLs. In order to correctly calculate sub-URLs
michael@529 59 + * below $base_url for embedded HTML forms, Drupal also has to know the
michael@529 60 + * URL on the local/origin server under which Drupal is contacted by the
michael@529 61 + * reverse proxy. This is what $base_url_local is for.
michael@529 62 + *
michael@529 63 + * Examples:
michael@529 64 + * $base_url_local = 'http://www.example.com:8080/drupal';
michael@529 65 + *
michael@529 66 + * It is not allowed to have a trailing slash; Drupal will add it
michael@529 67 + * for you.
michael@529 68 + */
michael@529 69 +# $base_url_local = 'http://www.example.com:8080/drupal'; // NO trailing slash!
michael@529 70 +
michael@529 71 +/**
michael@529 72 * PHP settings:
michael@529 73 *
michael@529 74 * To see what PHP settings are possible, including whether they can
michael@529 75
michael@529 76 -----------------------------------------------------------------------------
michael@529 77
michael@529 78 1. Support HTTP Proxies (mainly for update checks, RSS fetching, etc)
michael@529 79 http://drupal.org/node/7881
michael@529 80 http://drupal.org/files/issues/proxy_11.patch
michael@529 81 (post-adjusted and improved by RSE)
michael@529 82
michael@529 83 2. Fix CSS Cache Building Procedure
michael@529 84 http://drupal.org/node/275381
michael@529 85 http://drupal.org/files/issues/drupal-css-cache-building.patch
michael@529 86 (created by RSE)
michael@529 87
michael@529 88 Index: includes/common.inc
michael@529 89 --- includes/common.inc.orig 2008-04-09 23:11:44 +0200
michael@529 90 +++ includes/common.inc 2008-06-26 20:16:16 +0200
michael@529 91 @@ -439,13 +439,27 @@
michael@529 92 case 'http':
michael@529 93 $port = isset($uri['port']) ? $uri['port'] : 80;
michael@529 94 $host = $uri['host'] . ($port != 80 ? ':'. $port : '');
michael@529 95 - $fp = @fsockopen($uri['host'], $port, $errno, $errstr, 15);
michael@529 96 + if (variable_get('proxy_server', '') != '') {
michael@529 97 + $proxy_server = variable_get('proxy_server', '');
michael@529 98 + $proxy_port = variable_get('proxy_port', 8080);
michael@529 99 + $fp = @fsockopen($proxy_server, $proxy_port, $errno, $errstr, 15);
michael@529 100 + }
michael@529 101 + else {
michael@529 102 + $fp = @fsockopen($uri['host'], $port, $errno, $errstr, 15);
michael@529 103 + }
michael@529 104 break;
michael@529 105 case 'https':
michael@529 106 // Note: Only works for PHP 4.3 compiled with OpenSSL.
michael@529 107 $port = isset($uri['port']) ? $uri['port'] : 443;
michael@529 108 $host = $uri['host'] . ($port != 443 ? ':'. $port : '');
michael@529 109 - $fp = @fsockopen('ssl://'. $uri['host'], $port, $errno, $errstr, 20);
michael@529 110 + if (variable_get('proxy_server', '') != '') {
michael@529 111 + $proxy_server = variable_get('proxy_server', '');
michael@529 112 + $proxy_port = variable_get('proxy_port', 8080);
michael@529 113 + $fp = @fsockopen($proxy_server, $proxy_port, $errno, $errstr, 15);
michael@529 114 + }
michael@529 115 + else {
michael@529 116 + $fp = @fsockopen('ssl://'. $uri['host'], $port, $errno, $errstr, 20);
michael@529 117 + }
michael@529 118 break;
michael@529 119 default:
michael@529 120 $result->error = 'invalid schema '. $uri['scheme'];
michael@529 121 @@ -462,9 +476,14 @@
michael@529 122 }
michael@529 123
michael@529 124 // Construct the path to act on.
michael@529 125 - $path = isset($uri['path']) ? $uri['path'] : '/';
michael@529 126 - if (isset($uri['query'])) {
michael@529 127 - $path .= '?'. $uri['query'];
michael@529 128 + if (variable_get('proxy_server', '') != '') {
michael@529 129 + $path = $url;
michael@529 130 + }
michael@529 131 + else {
michael@529 132 + $path = isset($uri['path']) ? $uri['path'] : '/';
michael@529 133 + if (isset($uri['query'])) {
michael@529 134 + $path .= '?'. $uri['query'];
michael@529 135 + }
michael@529 136 }
michael@529 137
michael@529 138 // Create HTTP request.
michael@529 139 @@ -482,6 +501,14 @@
michael@529 140 $defaults['Authorization'] = 'Authorization: Basic '. base64_encode($uri['user'] . (!empty($uri['pass']) ? ":". $uri['pass'] : ''));
michael@529 141 }
michael@529 142
michael@529 143 + // If the proxy server required a username then attempt to authenticate with it
michael@529 144 + if (variable_get('proxy_username', '') != '') {
michael@529 145 + $username = variable_get('proxy_username', '');
michael@529 146 + $password = variable_get('proxy_password', '');
michael@529 147 + $auth_string = base64_encode($username . ($password != '' ? ':'. $password : ''));
michael@529 148 + $defaults['Proxy-Authorization'] = 'Proxy-Authorization: Basic '. $auth_string ."\r\n";
michael@529 149 + }
michael@529 150 +
michael@529 151 foreach ($headers as $header => $value) {
michael@529 152 $defaults[$header] = $header .': '. $value;
michael@529 153 }
michael@529 154 Index: modules/system/system.admin.inc
michael@529 155 --- modules/system/system.admin.inc.orig 2008-03-25 12:58:16 +0100
michael@529 156 +++ modules/system/system.admin.inc 2008-04-24 11:43:07 +0200
michael@529 157 @@ -1363,6 +1363,65 @@
michael@529 158 }
michael@529 159
michael@529 160 /**
michael@529 161 + * Form builder; Configure the site proxy settings.
michael@529 162 + *
michael@529 163 + * @ingroup forms
michael@529 164 + * @see system_settings_form()
michael@529 165 + */
michael@529 166 +function system_proxy_settings() {
michael@529 167 +
michael@529 168 + $form['forward_proxy'] = array(
michael@529 169 + '#type' => 'fieldset',
michael@529 170 + '#title' => t('Forward proxy settings'),
michael@529 171 + '#description' => t('The proxy server used when Drupal needs to connect to other sites on the Internet.'),
michael@529 172 + );
michael@529 173 + $form['forward_proxy']['proxy_server'] = array(
michael@529 174 + '#type' => 'textfield',
michael@529 175 + '#title' => t('Proxy host name'),
michael@529 176 + '#default_value' => variable_get('proxy_server', ''),
michael@529 177 + '#description' => t('The host name of the proxy server, eg. localhost. If this is empty Drupal will connect directly to the internet.')
michael@529 178 + );
michael@529 179 + $form['forward_proxy']['proxy_port'] = array(
michael@529 180 + '#type' => 'textfield',
michael@529 181 + '#title' => t('Proxy port number'),
michael@529 182 + '#default_value' => variable_get('proxy_port', 8080),
michael@529 183 + '#description' => t('The port number of the proxy server, eg. 8080'),
michael@529 184 + );
michael@529 185 + $form['forward_proxy']['proxy_username'] = array(
michael@529 186 + '#type' => 'textfield',
michael@529 187 + '#title' => t('Proxy username'),
michael@529 188 + '#default_value' => variable_get('proxy_username', ''),
michael@529 189 + '#description' => t('The username used to authenticate with the proxy server.'),
michael@529 190 + );
michael@529 191 + $form['forward_proxy']['proxy_password'] = array(
michael@529 192 + '#type' => 'textfield',
michael@529 193 + '#title' => t('Proxy password'),
michael@529 194 + '#default_value' => variable_get('proxy_password', ''),
michael@529 195 + '#description' => t('The password used to connect to the proxy server. This is kept as plain text.', '')
michael@529 196 + );
michael@529 197 + $form['#validate'][] = 'system_proxy_settings_validate';
michael@529 198 +
michael@529 199 + return system_settings_form($form);
michael@529 200 +}
michael@529 201 +
michael@529 202 +/**
michael@529 203 + * Validate the submitted proxy form.
michael@529 204 + */
michael@529 205 +function system_proxy_settings_validate($form, &$form_state) {
michael@529 206 + // Validate the proxy settings
michael@529 207 + $form_state['values']['proxy_server'] = trim($form_state['values']['proxy_server']);
michael@529 208 + if ($form_state['values']['proxy_server'] != '') {
michael@529 209 + // TCP allows the port to be between 0 and 65536 inclusive
michael@529 210 + if (!is_numeric($form_state['values']['proxy_port'])) {
michael@529 211 + form_set_error('proxy_port', t('The proxy port is invalid. It must be a number between 0 and 65535.'));
michael@529 212 + }
michael@529 213 + elseif ($form_state['values']['proxy_port'] < 0 || $form_state['values']['proxy_port'] >= 65536) {
michael@529 214 + form_set_error('proxy_port', t('The proxy port is invalid. It must be between 0 and 65535.'));
michael@529 215 + }
michael@529 216 + }
michael@529 217 +}
michael@529 218 +
michael@529 219 +/**
michael@529 220 * Form builder; Configure the site file handling.
michael@529 221 *
michael@529 222 * @ingroup forms
michael@529 223 Index: modules/system/system.module
michael@529 224 --- modules/system/system.module.orig 2008-04-09 23:11:49 +0200
michael@529 225 +++ modules/system/system.module 2008-04-24 11:43:47 +0200
michael@529 226 @@ -55,7 +55,7 @@
michael@529 227 $output .= '<li>'. t('support for enabling and disabling <a href="@themes">themes</a>, which determine the design and presentation of your site. Drupal comes packaged with several core themes and additional contributed themes are available at the <a href="@drupal-themes">Drupal.org theme page</a>.', array('@themes' => url('admin/build/themes'), '@drupal-themes' => 'http://drupal.org/project/themes')) .'</li>';
michael@529 228 $output .= '<li>'. t('a robust <a href="@cache-settings">caching system</a> that allows the efficient re-use of previously-constructed web pages and web page components. Drupal stores the pages requested by anonymous users in a compressed format; depending on your site configuration and the amount of your web traffic tied to anonymous visitors, Drupal\'s caching system may significantly increase the speed of your site.', array('@cache-settings' => url('admin/settings/performance'))) .'</li>';
michael@529 229 $output .= '<li>'. t('a set of routine administrative operations that rely on a correctly-configured <a href="@cron">cron maintenance task</a> to run automatically. A number of other modules, including the feed aggregator, ping module and search also rely on <a href="@cron">cron maintenance tasks</a>. For more information, see the online handbook entry for <a href="@handbook">configuring cron jobs</a>.', array('@cron' => url('admin/reports/status'), '@handbook' => 'http://drupal.org/cron')) .'</li>';
michael@529 230 - $output .= '<li>'. t('basic configuration options for your site, including <a href="@date-settings">date and time settings</a>, <a href="@file-system">file system settings</a>, <a href="@clean-url">clean URL support</a>, <a href="@site-info">site name and other information</a>, and a <a href="@site-maintenance">site maintenance</a> function for taking your site temporarily off-line.', array('@date-settings' => url('admin/settings/date-time'), '@file-system' => url('admin/settings/file-system'), '@clean-url' => url('admin/settings/clean-urls'), '@site-info' => url('admin/settings/site-information'), '@site-maintenance' => url('admin/settings/site-maintenance'))) .'</li></ul>';
michael@529 231 + $output .= '<li>'. t('basic configuration options for your site, including <a href="@date-settings">date and time settings</a>, <a href="@file-system">file system settings</a>, <a href="@clean-url">clean URL support</a>, <a href="@proxy-server">proxy server settings</a>, a href="@site-info">site name and other information</a>, and a <a href="@site-maintenance">site maintenance</a> function for taking your site temporarily off-line.', array('@date-settings' => url('admin/settings/date-time'), '@file-system' => url('admin/settings/file-system'), '@clean-url' => url('admin/settings/clean-urls'), '@site-info' => url('admin/settings/site-information'), '@site-maintenance' => url('admin/settings/site-maintenance'))) .'</li></ul>';
michael@529 232 $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@system">System module</a>.', array('@system' => 'http://drupal.org/handbook/modules/system/')) .'</p>';
michael@529 233 return $output;
michael@529 234 case 'admin':
michael@529 235 @@ -406,6 +406,14 @@
michael@529 236 'access arguments' => array('administer site configuration'),
michael@529 237 'file' => 'system.admin.inc',
michael@529 238 );
michael@529 239 + $items['admin/settings/proxy'] = array(
michael@529 240 + 'title' => 'Proxy server',
michael@529 241 + 'description' => 'Configure settings when the site is behind a proxy server.',
michael@529 242 + 'page callback' => 'drupal_get_form',
michael@529 243 + 'page arguments' => array('system_proxy_settings'),
michael@529 244 + 'access arguments' => array('administer site configuration'),
michael@529 245 + 'file' => 'system.admin.inc',
michael@529 246 + );
michael@529 247 $items['admin/settings/file-system'] = array(
michael@529 248 'title' => 'File system',
michael@529 249 'description' => 'Tell Drupal where to store uploaded files and how they are accessed.',
michael@529 250
michael@529 251 -----------------------------------------------------------------------------
michael@529 252
michael@529 253 Disable "Update notifications" check by default during installation.
michael@529 254
michael@529 255 Index: install.php
michael@529 256 --- install.php.orig 2008-02-08 23:00:45 +0100
michael@529 257 +++ install.php 2008-05-09 13:18:09 +0200
michael@529 258 @@ -1069,7 +1069,7 @@
michael@529 259 '#type' => 'checkboxes',
michael@529 260 '#title' => st('Update notifications'),
michael@529 261 '#options' => array(1 => st('Check for updates automatically')),
michael@529 262 - '#default_value' => array(1),
michael@529 263 + '#default_value' => array(),
michael@529 264 '#description' => st('With this option enabled, Drupal will notify you when new releases are available. This will significantly enhance your site\'s security and is <strong>highly recommended</strong>. This requires your site to periodically send anonymous information on its installed components to <a href="@drupal">drupal.org</a>. For more information please see the <a href="@update">update notification information</a>.', array('@drupal' => 'http://drupal.org', '@update' => 'http://drupal.org/handbook/modules/update')),
michael@529 265 '#weight' => 15,
michael@529 266 );
michael@529 267
michael@529 268 -----------------------------------------------------------------------------
michael@529 269
michael@529 270 No need to always expand the "Menu settings" on node edit pages.
michael@529 271
michael@529 272 Index: modules/menu/menu.module
michael@529 273 --- modules/menu/menu.module.orig 2008-04-09 23:11:48 +0200
michael@529 274 +++ modules/menu/menu.module 2008-05-16 20:03:48 +0200
michael@529 275 @@ -366,7 +366,7 @@
michael@529 276 '#title' => t('Menu settings'),
michael@529 277 '#access' => user_access('administer menu'),
michael@529 278 '#collapsible' => TRUE,
michael@529 279 - '#collapsed' => FALSE,
michael@529 280 + '#collapsed' => TRUE,
michael@529 281 '#tree' => TRUE,
michael@529 282 '#weight' => -2,
michael@529 283 '#attributes' => array('class' => 'menu-item-form'),
michael@529 284
michael@529 285 -----------------------------------------------------------------------------
michael@529 286
michael@529 287 Use a larger text-area on node edit pages.
michael@529 288
michael@529 289 Index: modules/node/node.pages.inc
michael@529 290 --- modules/node/node.pages.inc.orig 2008-02-27 20:44:44 +0100
michael@529 291 +++ modules/node/node.pages.inc 2008-05-16 20:06:45 +0200
michael@529 292 @@ -287,7 +287,8 @@
michael@529 293 '#type' => 'textarea',
michael@529 294 '#title' => check_plain($label),
michael@529 295 '#default_value' => $include ? $node->body : ($node->teaser . $node->body),
michael@529 296 - '#rows' => 20,
michael@529 297 + '#rows' => 30,
michael@529 298 + '#cols' => 80,
michael@529 299 '#required' => ($word_count > 0),
michael@529 300 );
michael@529 301
michael@529 302 -----------------------------------------------------------------------------
michael@529 303
michael@529 304 Avoid incorrect ordering of BLOG entries by removing the
michael@529 305 db_rewrite_sql() calls which seem to introduce a wrong ordering.
michael@529 306
michael@529 307 Index: modules/blog/blog.module
michael@529 308 --- modules/blog/blog.module.orig 2008-05-19 09:27:35 +0200
michael@529 309 +++ modules/blog/blog.module 2008-07-29 21:20:42 +0200
michael@529 310 @@ -182,13 +182,13 @@
michael@529 311 * Helper function to determine if a user has blog posts already.
michael@529 312 */
michael@529 313 function _blog_post_exists($account) {
michael@529 314 - return (bool)db_result(db_query_range(db_rewrite_sql("SELECT 1 FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1"), $account->uid, 0, 1));
michael@529 315 + return (bool)db_result(db_query_range("SELECT 1 FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1", $account->uid, 0, 1));
michael@529 316 }
michael@529 317
michael@529 318 /**
michael@529 319 * Implementation of hook_block().
michael@529 320 *
michael@529 321 - * Displays the most recent 10 blog titles.
michael@529 322 + * Displays the most recent 5 blog titles.
michael@529 323 */
michael@529 324 function blog_block($op = 'list', $delta = 0) {
michael@529 325 global $user;
michael@529 326 @@ -198,7 +198,7 @@
michael@529 327 }
michael@529 328 else if ($op == 'view') {
michael@529 329 if (user_access('access content')) {
michael@529 330 - $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, 10);
michael@529 331 + $result = db_query_range("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC", 0, 5);
michael@529 332 if ($node_title_list = node_title_list($result)) {
michael@529 333 $block['content'] = $node_title_list;
michael@529 334 $block['content'] .= theme('more_link', url('blog'), t('Read the latest blog entries.'));
michael@529 335 Index: modules/blog/blog.pages.inc
michael@529 336 --- modules/blog/blog.pages.inc.orig 2009-09-14 17:08:00 +0200
michael@529 337 +++ modules/blog/blog.pages.inc 2009-09-19 08:53:18 +0200
michael@529 338 @@ -25,7 +25,7 @@
michael@529 339
michael@529 340 $output = theme('item_list', $items);
michael@529 341
michael@529 342 - $result = pager_query(db_rewrite_sql("SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10), 0, NULL, $account->uid);
michael@529 343 + $result = pager_query("SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC", variable_get('default_nodes_main', 10), 0, NULL, $account->uid);
michael@529 344 $has_posts = FALSE;
michael@529 345
michael@529 346 while ($node = db_fetch_object($result)) {
michael@529 347 @@ -64,7 +64,7 @@
michael@529 348
michael@529 349 $output = theme('item_list', $items);
michael@529 350
michael@529 351 - $result = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10));
michael@529 352 + $result = pager_query("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC", variable_get('default_nodes_main', 10));
michael@529 353 $has_posts = FALSE;
michael@529 354
michael@529 355 while ($node = db_fetch_object($result)) {
michael@529 356 @@ -87,7 +87,7 @@
michael@529 357 * Menu callback; displays an RSS feed containing recent blog entries of a given user.
michael@529 358 */
michael@529 359 function blog_feed_user($account) {
michael@529 360 - $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.created DESC"), $account->uid, 0, variable_get('feed_default_items', 10));
michael@529 361 + $result = db_query_range("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.created DESC", $account->uid, 0, variable_get('feed_default_items', 10));
michael@529 362 $channel['title'] = t("!name's blog", array('!name' => $account->name));
michael@529 363 $channel['link'] = url('blog/'. $account->uid, array('absolute' => TRUE));
michael@529 364
michael@529 365 @@ -102,7 +102,7 @@
michael@529 366 * Menu callback; displays an RSS feed containing recent blog entries of all users.
michael@529 367 */
michael@529 368 function blog_feed_last() {
michael@529 369 - $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, variable_get('feed_default_items', 10));
michael@529 370 + $result = db_query_range("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC", 0, variable_get('feed_default_items', 10));
michael@529 371 $channel['title'] = t('!site_name blogs', array('!site_name' => variable_get('site_name', 'Drupal')));
michael@529 372 $channel['link'] = url('blog', array('absolute' => TRUE));
michael@529 373

mercurial