Commit 53420729 authored by Dries's avatar Dries
Browse files

- Patch #101927 by cooferat: fixed problem with post information.

parent bc1c4def
......@@ -253,6 +253,32 @@ function drupal_unset_globals() {
}
}
}
if ($cookie_domain) {
// If the user specifies the cookie domain, also use it for session name.
$session_name = $cookie_domain;
}
else {
// Otherwise use $base_url for session name.
$session_name = $base_url;
// We try to set the cookie domain to the hostname.
if (!empty($_SERVER['HTTP_HOST'])) {
$cookie_domain = $_SERVER['HTTP_HOST'];
}
}
// Strip leading periods, www., and port numbers from cookie domain.
$cookie_domain = ltrim($cookie_domain, '.');
if (strpos($cookie_domain, 'www.') === 0) {
$cookie_domain = substr($cookie_domain, 4);
}
$cookie_domain = explode(':', $cookie_domain);
$cookie_domain = '.'. array_shift($cookie_domain);
// Per RFC 2109, cookie domains must contain at least one dot other than the
// first. For hosts such as 'localhost' or IP Addresses we don't set a cookie domain.
if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) {
ini_set('session.cookie_domain', $cookie_domain);
}
session_name('SESS'. md5($session_name));
}
/**
......
......@@ -1752,7 +1752,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL) {
if (function_exists('locale_inc_callback')) {
locale_inc_callback('_locale_update_js_files');
}
if (!isset($javascript)) {
$javascript = drupal_add_js(NULL, NULL, $scope);
}
......
......@@ -778,7 +778,7 @@ function locale_translate_edit_form(&$form_state, $lid) {
'#default_value' => '',
);
}
// Fetch translations and fill in default values in the form.
$result = db_query("SELECT DISTINCT translation, language FROM {locales_target} WHERE lid = %d AND language != '%s'", $lid, $omit);
while ($translation = db_fetch_object($result)) {
......
......@@ -141,7 +141,9 @@ function chameleon_node($node, $teaser = 0, $page = 0) {
$output .= " </div>\n";
$submitted['node_submitted'] = theme_get_setting("toggle_node_info_$node->type") ? array('#title' => t("By !author at @date", array('!author' => theme('username', $node), '@date' => format_date($node->created, 'small')))) : array();
$submitted['node_submitted'] = theme_get_setting("toggle_node_info_$node->type") ? array(
'title' => t("By !author at @date", array('!author' => theme('username', $node), '@date' => format_date($node->created, 'small'))),
'html' => TRUE) : array();
$terms = array();
if (module_exists('taxonomy')) {
......@@ -162,7 +164,9 @@ function chameleon_node($node, $teaser = 0, $page = 0) {
}
function chameleon_comment($comment, $links = "") {
$submitted['comment_submitted'] = array('#title' => t('By !author at @date', array('!author' => theme('username', $comment), '@date' => format_date($comment->timestamp, 'small'))));
$submitted['comment_submitted'] = array(
'title' => t('By !author at @date', array('!author' => theme('username', $comment), '@date' => format_date($comment->timestamp, 'small'))),
'html' => TRUE);
$output = "<div class=\"comment". ($comment->status == COMMENT_NOT_PUBLISHED ? ' comment-unpublished' : '') ."\">\n";
$output .= " <h3 class=\"title\">". l($comment->subject, $_GET['q'], NULL, NULL, "comment-$comment->cid") ."</h3>\n";
......
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