From 355d25e73d90f3174db459a5a380193e0505ada4 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 4 Jun 2003 18:24:39 +0000 Subject: [PATCH] - Bugfix: renamed the SQL field 'types' to 'nodes' because 'types' is a reserved keyword in MySQL 4. This fixes critical bug #1618. Patch by Marco. ==> This fix requires to run update.php! - Bugfix: made sessions work without warnings when register_globals is turned off. The solution is to use $_SESSION instead of session_register(). This fixes critical bug #1797. Patch by Marco. - Bugfix: sometimes error messages where being discarded when previewing a node. Patch by Craig Courtney. - Bugfix: fixed charset problems. This fixes critical bug #1549. Patch '0023.charset.patch' by Al. - Code improvements: removed some dead code from the comment module. Patch by Marco. - Documentation improvements: polished the node module help texts and form descriptions. Patch '0019.node.module.help.patch' by Al. - CSS improvements all over the map! Patch '0021.more.css.patch' by Al. - GUI improvements: improved the position of Druplicon in the admin menu. Patch '0020.admin.logo.patch' by Al. - GUI improvements: new logos for theme Marvin and theme UnConeD. Logos by Kristjan Jansen. - GUI improvements: small changes to the output emitted by the profile module. Suggestions by Steven Wittens. - GUI improvements: small fixes to Xtemplate. Patch '0022.xtemplate.css.patch' by Al. TODO: - Some modules such as the buddy list module and the annotation module in the contributions repository are also using session_register(). They should be updated. We should setup a task on Drupal. - There is code emitting '
' which doesn't validate. - Does our XML feeds validate with the charset changes? - The forum module's SQL doesn't work properly on PostgreSQL. --- database/database.mssql | 2 +- database/database.mysql | 2 +- database/database.pgsql | 2 +- includes/common.inc | 32 +++++++++--------- includes/pager.inc | 14 ++++---- includes/theme.inc | 5 +-- misc/admin.css | 23 +++++++++---- misc/drupal.css | 21 +++++++++++- modules/admin.module | 3 +- modules/aggregator.module | 4 +-- modules/aggregator/aggregator.module | 4 +-- modules/comment.module | 31 ++++++----------- modules/comment/comment.module | 31 ++++++----------- modules/forum.module | 7 ++-- modules/forum/forum.module | 7 ++-- modules/import.module | 4 +-- modules/jabber.module | 6 ++-- modules/locale.module | 11 +++--- modules/locale/locale.module | 11 +++--- modules/node.module | 48 +++++++++++++++++---------- modules/node/node.module | 48 +++++++++++++++++---------- modules/poll.module | 20 ++++------- modules/poll/poll.module | 20 ++++------- modules/profile.module | 12 +++---- modules/profile/profile.module | 12 +++---- modules/queue.module | 4 +-- modules/story.module | 2 +- modules/story/story.module | 2 +- modules/system.module | 26 +++++++++++++++ modules/system/system.module | 26 +++++++++++++++ modules/taxonomy.module | 14 ++++---- modules/taxonomy/taxonomy.module | 14 ++++---- themes/marvin/images/logo.png | Bin 18085 -> 8279 bytes themes/marvin/marvin.theme | 1 - themes/unconed/images/logo.png | Bin 18085 -> 8055 bytes themes/unconed/unconed.theme | 1 - themes/xtemplate/xtemplate.css | 8 +++++ themes/xtemplate/xtemplate.xtmpl | 1 - update.php | 7 +++- 39 files changed, 282 insertions(+), 204 deletions(-) diff --git a/database/database.mssql b/database/database.mssql index c1615a682e0..9ba7ea501da 100644 --- a/database/database.mssql +++ b/database/database.mssql @@ -354,7 +354,7 @@ CREATE TABLE [dbo].[vocabulary] ( [hierarchy] [tinyint] NOT NULL , [multiple] [tinyint] NOT NULL , [required] [tinyint] NOT NULL , - [types] [text] NULL , + [nodes] [text] NULL , [weight] [smallint] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO diff --git a/database/database.mysql b/database/database.mysql index ab12707321a..1862f66d8c2 100644 --- a/database/database.mysql +++ b/database/database.mysql @@ -528,7 +528,7 @@ CREATE TABLE vocabulary ( hierarchy tinyint(3) unsigned NOT NULL default '0', multiple tinyint(3) unsigned NOT NULL default '0', required tinyint(3) unsigned NOT NULL default '0', - types text, + nodes text, weight tinyint(4) NOT NULL default '0', PRIMARY KEY (vid) ) TYPE=MyISAM; diff --git a/database/database.pgsql b/database/database.pgsql index e0502fc88eb..061cfb13631 100644 --- a/database/database.pgsql +++ b/database/database.pgsql @@ -530,7 +530,7 @@ CREATE TABLE vocabulary ( hierarchy smallint NOT NULL default '0', multiple smallint NOT NULL default '0', required smallint NOT NULL default '0', - types text default '', + nodes text default '', weight smallint NOT NULL default '0', PRIMARY KEY (vid) ); diff --git a/includes/common.inc b/includes/common.inc index 5327208985d..708ee9a391c 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -453,11 +453,8 @@ function drupal_goto($url) { */ function referer_save() { - global $referer; - if (!strstr($_SERVER["HTTP_REFERER"], request_uri())) { - $referer = $_SERVER["HTTP_REFERER"]; - session_register("referer"); + $_SESSION["referer"] = $_SERVER["HTTP_REFERER"]; } } @@ -466,10 +463,8 @@ function referer_save() { */ function referer_load() { - global $referer; - - if (session_is_registered("referer")) { - return $referer; + if (isset($_SESSION["referer"])) { + return $_SESSION["referer"]; } else { return 0; @@ -608,12 +603,12 @@ function format_rss_channel($title, $link, $description, $items, $language = "en // arbitrary elements may be added using the $args associative array $output .= "\n"; - $output .= " ". htmlentities(strip_tags($title)) ."\n"; - $output .= " ". htmlentities(strip_tags($link)) ."\n"; - $output .= " ". htmlentities($description) ."\n"; - $output .= " ". htmlentities(strip_tags($language)) ."\n"; + $output .= " ". htmlspecialchars(strip_tags($title)) ."\n"; + $output .= " ". htmlspecialchars(strip_tags($link)) ."\n"; + $output .= " ". htmlspecialchars($description) ."\n"; + $output .= " ". htmlspecialchars(strip_tags($language)) ."\n"; foreach ($args as $key => $value) { - $output .= "<$key>". htmlentities(strip_tags($value)) .""; + $output .= "<$key>". htmlspecialchars(strip_tags($value)) .""; } $output .= $items; $output .= "\n"; @@ -625,11 +620,11 @@ function format_rss_item($title, $link, $description, $args = array()) { // arbitrary elements may be added using the $args associative array $output .= "\n"; - $output .= " ". htmlentities(strip_tags($title)) ."\n"; - $output .= " ". htmlentities(strip_tags($link)) ."\n"; - $output .= " ". htmlentities(check_output($description)) ."\n"; + $output .= " ". htmlspecialchars(strip_tags($title)) ."\n"; + $output .= " ". htmlspecialchars(strip_tags($link)) ."\n"; + $output .= " ". htmlspecialchars(check_output($description)) ."\n"; foreach ($args as $key => $value) { - $output .= "<$key>". htmlentities(strip_tags($value)) .""; + $output .= "<$key>". htmlspecialchars(strip_tags($value)) .""; } $output .= "\n"; @@ -1004,6 +999,9 @@ $conf = variable_init(isset($conf) ? $conf : array()); // set error handler: set_error_handler("error_handler"); +// spit out the correct charset http header +header("Content-Type: text/html; charset=". variable_get("charset", "iso-8859-1")); + // initialize installed modules: module_init(); diff --git a/includes/pager.inc b/includes/pager.inc index f031f3a334c..a567499b2ee 100644 --- a/includes/pager.inc +++ b/includes/pager.inc @@ -31,13 +31,13 @@ function pager_display($tags = "", $limit = 10, $element = 0, $type = "default", function pager_display_default($tags = "", $limit = 10, $element = 0, $attributes = array()) { global $pager_total; if ($pager_total[$element] > $limit) { - $output .= "
"; - $output .= ""; - $output .= ""; - $output .= ""; - $output .= ""; - $output .= ""; - $output .= "
". pager_first(($tags[0] ? $tags[0] : t("first page")), $limit, $element, $attributes) ."". pager_previous(($tags[1] ? $tags[1] : t("previous page")), $limit, $element, 1, $attributes) ."". pager_list($limit, $element, ($tags[2] ? $tags[2] : 9 ), "", $attributes) ."". pager_next(($tags[3] ? $tags[3] : t("next page")), $limit, $element, 1, $attributes) ."". pager_last(($tags[4] ? $tags[4] : t("last page")), $limit, $element, $attributes) ."
"; + $output .= "
"; + $output .= "
". pager_first(($tags[0] ? $tags[0] : t("first page")), $limit, $element, $attributes) ."
"; + $output .= "
". pager_previous(($tags[1] ? $tags[1] : t("previous page")), $limit, $element, 1, $attributes) ."
"; + $output .= "
". pager_list($limit, $element, ($tags[2] ? $tags[2] : 9 ), "", $attributes) ."
"; + $output .= "
". pager_next(($tags[3] ? $tags[3] : t("next page")), $limit, $element, 1, $attributes) ."
"; + $output .= "
". pager_last(($tags[4] ? $tags[4] : t("last page")), $limit, $element, $attributes) ."
"; + $output .= "
"; return $output; } diff --git a/includes/theme.inc b/includes/theme.inc index c410e36a770..dce4cff1bdc 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -92,7 +92,7 @@ function theme_mark() { ** Return a marker. Used to indicate new comments or required form ** fields. */ - return "*"; + return "*"; } function theme_item_list($items = array(), $title = NULL) { @@ -119,7 +119,7 @@ function theme_error($message) { /* ** Return an error message. */ - return "
$message
"; + return "
$message
"; } function theme_list($refresh = 0) { @@ -144,6 +144,7 @@ function theme_list($refresh = 0) { function theme_head($main = 0) { global $base_url; + $output .= ""; $output .= "\n"; $output .= "