Commit 355d25e7 authored by Dries's avatar Dries

- 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 '<div align="right">' which doesn't validate.

- Does our XML feeds validate with the charset changes?

- The forum module's SQL doesn't work properly on PostgreSQL.
parent 3151a1cb
......@@ -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
......
......@@ -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;
......
......@@ -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)
);
......
......@@ -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 .= "<channel>\n";
$output .= " <title>". htmlentities(strip_tags($title)) ."</title>\n";
$output .= " <link>". htmlentities(strip_tags($link)) ."</link>\n";
$output .= " <description>". htmlentities($description) ."</description>\n";
$output .= " <language>". htmlentities(strip_tags($language)) ."</language>\n";
$output .= " <title>". htmlspecialchars(strip_tags($title)) ."</title>\n";
$output .= " <link>". htmlspecialchars(strip_tags($link)) ."</link>\n";
$output .= " <description>". htmlspecialchars($description) ."</description>\n";
$output .= " <language>". htmlspecialchars(strip_tags($language)) ."</language>\n";
foreach ($args as $key => $value) {
$output .= "<$key>". htmlentities(strip_tags($value)) ."</$key>";
$output .= "<$key>". htmlspecialchars(strip_tags($value)) ."</$key>";
}
$output .= $items;
$output .= "</channel>\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 .= "<item>\n";
$output .= " <title>". htmlentities(strip_tags($title)) ."</title>\n";
$output .= " <link>". htmlentities(strip_tags($link)) ."</link>\n";
$output .= " <description>". htmlentities(check_output($description)) ."</description>\n";
$output .= " <title>". htmlspecialchars(strip_tags($title)) ."</title>\n";
$output .= " <link>". htmlspecialchars(strip_tags($link)) ."</link>\n";
$output .= " <description>". htmlspecialchars(check_output($description)) ."</description>\n";
foreach ($args as $key => $value) {
$output .= "<$key>". htmlentities(strip_tags($value)) ."</$key>";
$output .= "<$key>". htmlspecialchars(strip_tags($value)) ."</$key>";
}
$output .= "</item>\n";
......@@ -1004,6 +999,9 @@ function drupal_page_footer() {
// 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();
......
......@@ -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 .= "<div align=\"center\"><table cellpadding=\"10\"><tbody><tr>";
$output .= "<td align=\"center\">". pager_first(($tags[0] ? $tags[0] : t("first page")), $limit, $element, $attributes) ."</td>";
$output .= "<td align=\"center\">". pager_previous(($tags[1] ? $tags[1] : t("previous page")), $limit, $element, 1, $attributes) ."</td>";
$output .= "<td align=\"center\">". pager_list($limit, $element, ($tags[2] ? $tags[2] : 9 ), "", $attributes) ."</td>";
$output .= "<td align=\"center\">". pager_next(($tags[3] ? $tags[3] : t("next page")), $limit, $element, 1, $attributes) ."</td>";
$output .= "<td align=\"center\">". pager_last(($tags[4] ? $tags[4] : t("last page")), $limit, $element, $attributes) ."</td>";
$output .= "</tr></tbody></table></div>";
$output .= "<div id=\"pager\" class=\"container-inline\">";
$output .= "<div>". pager_first(($tags[0] ? $tags[0] : t("first page")), $limit, $element, $attributes) ."</div>";
$output .= "<div>". pager_previous(($tags[1] ? $tags[1] : t("previous page")), $limit, $element, 1, $attributes) ."</div>";
$output .= "<div>". pager_list($limit, $element, ($tags[2] ? $tags[2] : 9 ), "", $attributes) ."</div>";
$output .= "<div>". pager_next(($tags[3] ? $tags[3] : t("next page")), $limit, $element, 1, $attributes) ."</div>";
$output .= "<div>". pager_last(($tags[4] ? $tags[4] : t("last page")), $limit, $element, $attributes) ."</div>";
$output .= "</div>";
return $output;
}
......
......@@ -92,7 +92,7 @@ function theme_mark() {
** Return a marker. Used to indicate new comments or required form
** fields.
*/
return "<span style=\"color: red;\">*</span>";
return "<span class=\"marker\">*</span>";
}
function theme_item_list($items = array(), $title = NULL) {
......@@ -119,7 +119,7 @@ function theme_error($message) {
/*
** Return an error message.
*/
return "<div style=\"color: red;\">$message</div>";
return "<div class=\"error\">$message</div>";
}
function theme_list($refresh = 0) {
......@@ -144,6 +144,7 @@ function theme_list($refresh = 0) {
function theme_head($main = 0) {
global $base_url;
$output .= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=". variable_get("site_charset", "iso-8859-1") ."\" />";
$output .= "<base href=\"$base_url/\" />\n";
$output .= "<style type=\"text/css\">\n";
$output .= "@import url(misc/drupal.css);\n";
......
......@@ -36,24 +36,26 @@ table {
}
th {
text-align: left;
padding-right: 1em;
color: #006;
border-bottom: 1px solid #ccc;
}
tr.dark {
background-color: #ddd;
}
tr.light {
background-color: #eee;
}
td {
padding: 5px;
font-size: 90%;
font-size: 0.9em;
}
hr {
clear: both;
margin: .5em 0;
height: 1px;
color: #ccc;
}
dt {
font-weight: bold;
}
dd {
margin-bottom: 0.5em;
}
#menu {
position: absolute;
left: 0px;
......@@ -115,6 +117,13 @@ hr {
padding: 1em 1em 1em 0;
z-index: 2;
}
#logo {
padding: 1em 1em 0 1em;
float: right;
}
#logo img {
border: 0;
}
#update {
padding: 1em 1em 1em 1em;
}
form { margin: 0; padding: 0;}
#tracker table { border-collapse: collapse; }
#tracker td { vertical-align: top; padding: 1em; }
#tracker td ul { margin-top: 0; margin-bottom: 0; }
#tracker td ul a { font-weight: normal; }
#tracker th { text-align: left; padding: 0.25em 1em; }
#pager { text-align: center; }
#pager div { padding: 0.5em; }
.queue-user-numeral { color: red; }
.calendar .row-week td a { display: block; }
.calendar .row-week td a:hover { background-color: #888; color: #fff; }
.calendar a { text-decoration: none; }
......@@ -15,7 +22,7 @@
.form-item .description { font-size: 0.85em; }
.form-item .title { font-weight: bold; margin-top: 1.1em; margin-bottom: 1px; }
.form-submit { margin-top: 1em; }
.form-submit { margin: 0.5em 0; }
.item-list .icon { color: #555; float: right; padding-left: 0.25em; }
.item-list .icon a { color: #000; text-decoration: none; }
......@@ -30,6 +37,18 @@
.poll .links { text-align: center; }
.poll .percent { text-align: right; }
.poll .total { text-align: center; }
.poll .vote-form { text-align: center; }
.poll .vote-form .choices { text-align: left; margin: 0 auto; display: table; }
.node-form .admin { float: right; width: 14em; margin-top: -1.1em; }
.node-form .standard { margin-right: 14em; }
.node-form .form-text { width: 95%; }
.node-form textarea { width: 95%; }
.marker { color: #f00; }
.error { color: #f00; }
.ok { color: #080; }
.user-login-block { text-align: center; }
......
......@@ -41,7 +41,6 @@ function admin_page() {
<html>
<head>
<title><?php echo variable_get("site_name", "drupal") . " " . t("administration pages"); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<?php print theme_head(); ?>
<link rel="stylesheet" type="text/css" media="print" href="misc/print.css" />
<style type="text/css" title="layout" media="Screen">
......@@ -58,7 +57,7 @@ function admin_page() {
** Body:
*/
print "<a href=\"http://drupal.org/\"><img align=\"right\" src=\"misc/druplicon-small.gif\" alt=\"Druplicon - Drupal logo\" border=\"0\" /></a>";
print "<div id=\"logo\"><a href=\"http://drupal.org/\"><img src=\"misc/druplicon-small.gif\" alt=\"Druplicon - Drupal logo\" /></a></div>";
print "<div id=\"main\">";
if ($path = menu_path()) {
......
......@@ -711,8 +711,8 @@ function import_page_fd() {
while ($feed = db_fetch_object($result)) {
$output .= "<channel>\n";
$output .= " <title>". htmlentities($feed->title) ."</title>\n";
$output .= " <link>". htmlentities($feed->url) ."</link>\n";
$output .= " <title>". htmlspecialchars($feed->title) ."</title>\n";
$output .= " <link>". htmlspecialchars($feed->url) ."</link>\n";
$output .= "</channel>\n\n";
}
......
......@@ -711,8 +711,8 @@ function import_page_fd() {
while ($feed = db_fetch_object($result)) {
$output .= "<channel>\n";
$output .= " <title>". htmlentities($feed->title) ."</title>\n";
$output .= " <link>". htmlentities($feed->url) ."</link>\n";
$output .= " <title>". htmlspecialchars($feed->title) ."</title>\n";
$output .= " <link>". htmlspecialchars($feed->url) ."</link>\n";
$output .= "</channel>\n\n";
}
......
......@@ -823,7 +823,7 @@ function comment_admin_overview($status = 0) {
$header = array(t("subject"), t("author"), t("status"), array("data" => t("operations"), "colspan" => 2));
while ($comment = db_fetch_object($result)) {
$rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlentities(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme_mark() : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
$rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme_mark() : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
}
if ($pager = pager_display(NULL, 50, 0, "admin")) {
......@@ -996,8 +996,6 @@ function comment_mod_filters($edit) {
function comment_admin() {
global $id, $mod, $keys, $order, $status, $comment_page, $comment_settings;
$op = $_POST["op"];
$edit = $_POST["edit"];
......@@ -1050,18 +1048,10 @@ function comment_admin() {
break;
case t("Delete"):
print status(comment_delete($edit));
if (session_is_registered("comment_settings")) {
$status = $comment_settings["status"];
$comment_page = $comment_settings["comment_page"];
}
print comment_admin_overview(0);
break;
case t("Submit"):
print status(comment_save(check_query(arg(3)), $edit));
if (session_is_registered("comment_settings")) {
$status = $comment_settings["status"];
$comment_page = $comment_settings["comment_page"];
}
print comment_admin_overview(0);
break;
default:
......@@ -1189,20 +1179,19 @@ function comment_moderation_form($comment) {
return $output;
}
function comment($comment, $link = 0) {
$output .= "<div style=\"border: 1px solid; padding: 10px;\">";
$output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
$output .= " <tr><td><div style=\"font-size: 110%; font-weight: bold;\">$comment->subject ". ($comment->new ? theme("theme_mark") : "") ."</div></td><td align=\"right\" rowspan=\"2\" valign=\"top\">". $comment->moderation ."</td></tr>";
$output .= " <tr><td><div style=\"margin-left: 10px; padding-bottom: 10px; font-size: 90%;\">". t("by %a on %b", array("%a" => format_name($comment), "%b" => format_date($comment->timestamp))) ."</div></td></tr>";
$output .= " <tr><td colspan=\"2\">". check_output($comment->comment) ."</td></tr>";
$output .= " <tr><td align=\"right\" colspan=\"2\">$link</td></tr>";
$output .= "</table>";
$output .= "</div><br />";
function comment($comment, $links = 0) {
$output .= "<div class=\"comment\">";
$output .= "<div class=\"subject\">$comment->subject". ($comment->new ? " ". theme("theme_mark") : "") ."</div>";
$output .= "<div class=\"moderation\">". $comment->moderation ."</div>";
$output .= "<div class=\"credit\">". t("by %a on %b", array("%a" => format_name($comment), "%b" => format_date($comment->timestamp))) ."</div>";
$output .= "<div class=\"body\">". check_output($comment->comment) ."</div";
$output .= "<div class=\"links\">$links</div>";
$output .= "</div>";
print $output;
}
function comment_folded($comment) {
print "<p>". l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid") ." <small>". t("by") . " " . format_name($comment) ."</small></p>";
print "<div class=\"comment-folded\"><span class=\"subject\">". l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid") ."</span> <span class=\"credit\">". t("by") . " " . format_name($comment) ."</span></div>";
}
function comment_flat_collapsed($comments, $threshold) {
......
......@@ -823,7 +823,7 @@ function comment_admin_overview($status = 0) {
$header = array(t("subject"), t("author"), t("status"), array("data" => t("operations"), "colspan" => 2));
while ($comment = db_fetch_object($result)) {
$rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlentities(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme_mark() : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
$rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme_mark() : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
}
if ($pager = pager_display(NULL, 50, 0, "admin")) {
......@@ -996,8 +996,6 @@ function comment_mod_filters($edit) {
function comment_admin() {
global $id, $mod, $keys, $order, $status, $comment_page, $comment_settings;
$op = $_POST["op"];
$edit = $_POST["edit"];
......@@ -1050,18 +1048,10 @@ function comment_admin() {
break;
case t("Delete"):
print status(comment_delete($edit));
if (session_is_registered("comment_settings")) {
$status = $comment_settings["status"];
$comment_page = $comment_settings["comment_page"];
}
print comment_admin_overview(0);
break;
case t("Submit"):
print status(comment_save(check_query(arg(3)), $edit));
if (session_is_registered("comment_settings")) {
$status = $comment_settings["status"];
$comment_page = $comment_settings["comment_page"];
}
print comment_admin_overview(0);
break;
default:
......@@ -1189,20 +1179,19 @@ function comment_moderation_form($comment) {
return $output;
}
function comment($comment, $link = 0) {
$output .= "<div style=\"border: 1px solid; padding: 10px;\">";
$output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
$output .= " <tr><td><div style=\"font-size: 110%; font-weight: bold;\">$comment->subject ". ($comment->new ? theme("theme_mark") : "") ."</div></td><td align=\"right\" rowspan=\"2\" valign=\"top\">". $comment->moderation ."</td></tr>";
$output .= " <tr><td><div style=\"margin-left: 10px; padding-bottom: 10px; font-size: 90%;\">". t("by %a on %b", array("%a" => format_name($comment), "%b" => format_date($comment->timestamp))) ."</div></td></tr>";
$output .= " <tr><td colspan=\"2\">". check_output($comment->comment) ."</td></tr>";
$output .= " <tr><td align=\"right\" colspan=\"2\">$link</td></tr>";
$output .= "</table>";
$output .= "</div><br />";
function comment($comment, $links = 0) {
$output .= "<div class=\"comment\">";
$output .= "<div class=\"subject\">$comment->subject". ($comment->new ? " ". theme("theme_mark") : "") ."</div>";
$output .= "<div class=\"moderation\">". $comment->moderation ."</div>";
$output .= "<div class=\"credit\">". t("by %a on %b", array("%a" => format_name($comment), "%b" => format_date($comment->timestamp))) ."</div>";
$output .= "<div class=\"body\">". check_output($comment->comment) ."</div";
$output .= "<div class=\"links\">$links</div>";
$output .= "</div>";
print $output;
}
function comment_folded($comment) {
print "<p>". l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid") ." <small>". t("by") . " " . format_name($comment) ."</small></p>";
print "<div class=\"comment-folded\"><span class=\"subject\">". l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid") ."</span> <span class=\"credit\">". t("by") . " " . format_name($comment) ."</span></div>";
}
function comment_flat_collapsed($comments, $threshold) {
......
......@@ -63,7 +63,7 @@ function forum_settings() {
function forum_taxonomy($op, $type, $object) {
if ($type == "vocabulary" && ($op == "insert" || $op == "update")) {
if (variable_get("forum_nav_vocabulary", "") == "" && in_array("forum", $object["types"])) {
if (variable_get("forum_nav_vocabulary", "") == "" && in_array("forum", $object["nodes"])) {
// since none is already set, silently set this vocabulary as the navigation vocabulary
variable_set("forum_nav_vocabulary", $object["vid"]);
}
......@@ -452,11 +452,10 @@ function _forum_message_taxonomy() {
function forum_page() {
global $sortby, $forum_per_page, $from, $user;
$op = $_POST["op"];
print "WOOOT";
if (user_access("access content")) {
if (module_exist("taxonomy")) {
$tid = arg(1);
if ($op == "Update settings" && $user->uid) {
$user = user_save($user, array("sortby" => $sortby, "forum_per_page" => $forum_per_page));
}
......@@ -477,7 +476,9 @@ function forum_page() {
$offset = ($from / $forum_per_page) + 1;
$forums = forum_get_forums($tid);
$parents = forum_get_parents($tid);
if ($tid && !in_array($tid, variable_get("forum_containers", array()))) {
$topics = forum_get_topics($tid, $sortby, $forum_per_page);
......
......@@ -63,7 +63,7 @@ function forum_settings() {
function forum_taxonomy($op, $type, $object) {
if ($type == "vocabulary" && ($op == "insert" || $op == "update")) {
if (variable_get("forum_nav_vocabulary", "") == "" && in_array("forum", $object["types"])) {
if (variable_get("forum_nav_vocabulary", "") == "" && in_array("forum", $object["nodes"])) {
// since none is already set, silently set this vocabulary as the navigation vocabulary
variable_set("forum_nav_vocabulary", $object["vid"]);
}
......@@ -452,11 +452,10 @@ function _forum_message_taxonomy() {
function forum_page() {
global $sortby, $forum_per_page, $from, $user;
$op = $_POST["op"];
print "WOOOT";
if (user_access("access content")) {
if (module_exist("taxonomy")) {
$tid = arg(1);
if ($op == "Update settings" && $user->uid) {
$user = user_save($user, array("sortby" => $sortby, "forum_per_page" => $forum_per_page));
}
......@@ -477,7 +476,9 @@ function forum_page() {
$offset = ($from / $forum_per_page) + 1;
$forums = forum_get_forums($tid);
$parents = forum_get_parents($tid);
if ($tid && !in_array($tid, variable_get("forum_containers", array()))) {
$topics = forum_get_topics($tid, $sortby, $forum_per_page);
......
......@@ -711,8 +711,8 @@ function import_page_fd() {
while ($feed = db_fetch_object($result)) {
$output .= "<channel>\n";
$output .= " <title>". htmlentities($feed->title) ."</title>\n";
$output .= " <link>". htmlentities($feed->url) ."</link>\n";
$output .= " <title>". htmlspecialchars($feed->title) ."</title>\n";
$output .= " <link>". htmlspecialchars($feed->url) ."</link>\n";
$output .= "</channel>\n\n";
}
......
......@@ -41,7 +41,7 @@ function jabber_data($parser, $data) {
function jabber_send($session, $message) {
// print "SEND: ". htmlentities($message) ."<br />";
// print "SEND: ". htmlspecialchars($message) ."<br />";
fwrite($session, $message, strlen($message));
}
......@@ -66,7 +66,7 @@ function jabber_recv($session, $timout = 50) {
}
if ($message) {
// print "RECV: ". htmlentities($message) ."<br />";
// print "RECV: ". htmlspecialchars($message) ."<br />";
return $message;
}
......@@ -180,4 +180,4 @@ function jabber_user($type, $edit, $user) {
}
}
?>
\ No newline at end of file
?>
......@@ -103,7 +103,7 @@ function locale_edit($lid) {
$result = db_query("SELECT * FROM locales WHERE lid = '$lid'");
if ($translation = db_fetch_object($result)) {
$form .= form_item(t("Original text"), wordwrap(htmlentities($translation->string)));
$form .= form_item(t("Original text"), wordwrap(htmlspecialchars($translation->string)));
foreach ($languages as $code=>$language) {
$form .= (strlen($translation->string) > 30) ? form_textarea($language, $code, $translation->$code, 50, 10) : form_textfield($language, $code, $translation->$code, 50, 128);
......@@ -126,16 +126,15 @@ function locale_languages($translation) {
}
function locale_seek() {
global $id, $languages, $locale_settings;
global $id, $languages;
$op = $_POST["op"];
$edit = $_POST["edit"];
if ($op != 'overview' && !$edit && session_is_registered("locale_settings")) {
$edit = $locale_settings;
if ($op != 'overview' && !$edit && isset($_SESSION["locale_settings"])) {
$edit = $_SESSION["locale_settings"];
}
else {
$locale_settings = $edit;
session_register("locale_settings");
$_SESSION["locale_settings"] = $edit;
}
if (is_array($edit)) {
......
......@@ -103,7 +103,7 @@ function locale_edit($lid) {
$result = db_query("SELECT * FROM locales WHERE lid = '$lid'");
if ($translation = db_fetch_object($result)) {
$form .= form_item(t("Original text"), wordwrap(htmlentities($translation->string)));
$form .= form_item(t("Original text"), wordwrap(htmlspecialchars($translation->string)));
foreach ($languages as $code=>$language) {
$form .= (strlen($translation->string) > 30) ? form_textarea($language, $code, $translation->$code, 50, 10) : form_textfield($language, $code, $translation->$code, 50, 128);
......@@ -126,16 +126,15 @@ function locale_languages($translation) {
}
function locale_seek() {
global $id, $languages, $locale_settings;
global $id, $languages;
$op = $_POST["op"];
$edit = $_POST["edit"];
if ($op != 'overview' && !$edit && session_is_registered("locale_settings")) {
$edit = $locale_settings;
if ($op != 'overview' && !$edit && isset($_SESSION["locale_settings"])) {
$edit = $_SESSION["locale_settings"];
}
else {
$locale_settings = $edit;
session_register("locale_settings");
$_SESSION["locale_settings"] = $edit;
}
if (is_array($edit)) {
......
This diff is collapsed.
This diff is collapsed.
......@@ -256,26 +256,20 @@ function poll_view_voting(&$node, $main, $block, $links) {
$url = request_uri();
$output .= "<form action=\"$url\" method=\"post\">";
$output .= "<table border=\"0\" align=\"center\"><tr><td>";
$output .= "<div class=\"poll\"><form action=\"$url\" method=\"post\">";
$output .= "<div class=\"vote-form\">";
$output .= "<div class=\"choices\">";
if ($node->choice) {
foreach ($node->choice as $key => $value) {
if ($value != "") {
$output .= "<input type=\"radio\" name=\"pollvote[$node->nid]\" value=\"$key\" />". filter($value) ."<br />";
$output .= "<div><input type=\"radio\" name=\"pollvote[$node->nid]\" value=\"$key\" />". filter($value) ."</div>";
}
}
}
if ($block) {
$output .= "</td></tr><tr><td><div align=\"center\">". form_submit(t("Vote")) ."</div></td></tr></table>";
}
else {
$output .= "</td><td valign=\"middle\"><div align=\"right\">&nbsp;&nbsp;&nbsp;". form_submit(t("Vote")) ."</div></td></tr></table>";
}
$output .= $block ? "<div align=\"center\">". theme("links", $links) ."</div>" : "";
$output .= "</form>";
$output .= "</div>". form_submit(t("Vote")) ."</div>";
$output .= $block ? "<div class=\"links\">". theme("links", $links) ."</div>" : "";
$output .= "</form></div>";
return $output;
}
......
......@@ -256,26 +256,20 @@ function poll_view_voting(&$node, $main, $block, $links) {
$url = request_uri();
$output .= "<form action=\"$url\" method=\"post\">";
$output .= "<table border=\"0\" align=\"center\"><tr><td>";
$output .= "<div class=\"poll\"><form action=\"$url\" method=\"post\">";
$output .= "<div class=\"vote-form\">";
$output .= "<div class=\"choices\">";
if ($node->choice) {
foreach ($node->choice as $key => $value) {
if ($value != "") {
$output .= "<input type=\"radio\" name=\"pollvote[$node->nid]\" value=\"$key\" />". filter($value) ."<br />";
$output .= "<div><input type=\"radio\" name=\"pollvote[$node->nid]\" value=\"$key\" />". filter($value) ."</div>";
}
}
}
if ($block) {
$output .= "</td></tr><tr><td><div align=\"center\">". form_submit(t("Vote")) ."</div></td></tr></table>";
}
else {