# HG changeset patch # User Franck Deroche # Date 1230038961 -3600 # Node ID 165d43f946a8bec4cfbbf224990cd388a375ef10 # Parent 85b5b336180c43777ecc5433d0bb775923b5ba46 Drupal 6.1 diff -r 85b5b336180c -r 165d43f946a8 CHANGELOG.txt --- a/CHANGELOG.txt Tue Dec 23 14:28:28 2008 +0100 +++ b/CHANGELOG.txt Tue Dec 23 14:29:21 2008 +0100 @@ -1,4 +1,9 @@ -// $Id: CHANGELOG.txt,v 1.253.2.3 2008/02/13 14:25:42 goba Exp $ +// $Id: CHANGELOG.txt,v 1.253.2.5 2008/02/27 19:44:44 goba Exp $ + +Drupal 6.1, 2008-02-27 +---------------------- +- fixed a variety of small bugs. +- fixed a security issue (Cross site scripting), see SA-2008-018 Drupal 6.0, 2008-02-13 ---------------------- diff -r 85b5b336180c -r 165d43f946a8 includes/common.inc --- a/includes/common.inc Tue Dec 23 14:28:28 2008 +0100 +++ b/includes/common.inc Tue Dec 23 14:29:21 2008 +0100 @@ -1,5 +1,5 @@ array(), 'theme' => array()); } - - // If a theme is adding the current stylesheet, check for any existing CSS files - // with the same name. If they exist, remove them and allow the theme's own CSS - // file to replace it. - if ($type == 'theme') { - foreach ($css[$media]['module'] as $old_path => $old_preprocess) { - // Match by style sheet name. - if (basename($path) == basename($old_path)) { - unset($css[$media]['module'][$old_path]); - - // If the current language is RTL and the CSS file had an RTL variant, - // pull out the original. The theme must provide its own RTL style. - if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) { - $rtl_old_path = str_replace('.css', '-rtl.css', $old_path); - if (isset($css[$media]['module'][$rtl_old_path])) { - unset($css[$media]['module'][$rtl_old_path]); - } - } - // Set the preprocess state of the current module, then exit the search loop. - $preprocess = $old_preprocess; - break; - } - } - } $css[$media][$type][$path] = $preprocess; // If the current language is RTL, add the CSS file with RTL overrides. @@ -1692,9 +1660,18 @@ /** * Returns a themed representation of all stylesheets that should be attached to the page. * - * It loads the CSS in order, with 'core' CSS first, then 'module' CSS, then - * 'theme' CSS files. This ensures proper cascading of styles for easy - * overriding in modules and themes. + * It loads the CSS in order, with 'module' first, then 'theme' afterwards. + * This ensures proper cascading of styles so themes can easily override + * module styles through CSS selectors. + * + * Themes may replace module-defined CSS files by adding a stylesheet with the + * same filename. For example, themes/garland/system-menus.css would replace + * modules/system/system-menus.css. This allows themes to override complete + * CSS files, rather than specific selectors, when necessary. + * + * If the original CSS file is being overridden by a theme, the theme is + * responsible for supplying an accompanying RTL CSS file to replace the + * module's. * * @param $css * (optional) An array of CSS files. If no array is provided, the default @@ -1724,7 +1701,19 @@ // If CSS preprocessing is off, we still need to output the styles. // Additionally, go through any remaining styles if CSS preprocessing is on and output the non-cached ones. foreach ($types as $type => $files) { + if ($type == 'module') { + // Setup theme overrides for module styles. + $theme_styles = array(); + foreach (array_keys($css[$media]['theme']) as $theme_style) { + $theme_styles[] = basename($theme_style); + } + } foreach ($types[$type] as $file => $preprocess) { + // If the theme supplies its own style using the name of the module style, skip its inclusion. + // This includes any RTL styles associated with its main LTR counterpart. + if ($type == 'module' && in_array(str_replace('-rtl.css', '.css', basename($file)), $theme_styles)) { + continue; + } if (!$preprocess || !($is_writable && $preprocess_css)) { // If a CSS file is not to be preprocessed and it's a module CSS file, it needs to *always* appear at the *top*, // regardless of whether preprocessing is on or off. diff -r 85b5b336180c -r 165d43f946a8 includes/menu.inc --- a/includes/menu.inc Tue Dec 23 14:28:28 2008 +0100 +++ b/includes/menu.inc Tue Dec 23 14:29:21 2008 +0100 @@ -1,5 +1,5 @@ ': '>' }; for (var character in replace) { - str = str.replace(character, replace[character]); + var regex = new RegExp(character, 'g'); + str = str.replace(regex, replace[character]); } return str; }; diff -r 85b5b336180c -r 165d43f946a8 modules/block/block.admin.inc --- a/modules/block/block.admin.inc Tue Dec 23 14:28:28 2008 +0100 +++ b/modules/block/block.admin.inc Tue Dec 23 14:29:21 2008 +0100 @@ -1,5 +1,5 @@ $value) { - $cond[] = 'n.'. db_escape_string($key) ." = '%s'"; + $cond[] = 'n.'. db_escape_table($key) ." = '%s'"; $arguments[] = $value; } $cond = implode(' AND ', $cond); diff -r 85b5b336180c -r 165d43f946a8 modules/node/node.pages.inc --- a/modules/node/node.pages.inc Tue Dec 23 14:28:28 2008 +0100 +++ b/modules/node/node.pages.inc Tue Dec 23 14:29:21 2008 +0100 @@ -1,5 +1,5 @@ title); + drupal_set_title(check_plain($node->title)); return drupal_get_form($node->type .'_node_form', $node); } diff -r 85b5b336180c -r 165d43f946a8 modules/system/system.module --- a/modules/system/system.module Tue Dec 23 14:28:28 2008 +0100 +++ b/modules/system/system.module Tue Dec 23 14:29:21 2008 +0100 @@ -1,5 +1,5 @@