summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-06-11 15:21:14 +0000
committerDries Buytaert <dries@buytaert.net>2007-06-11 15:21:14 +0000
commit53420729ea164c0cc6244316a3001f64e919dc2c (patch)
treef3d13483601738a2563ba5e72ebd20960e2e0062
parentbc1c4defa2962db7c32a92dfa759a27eb3645caf (diff)
downloadbrdo-53420729ea164c0cc6244316a3001f64e919dc2c.tar.gz
brdo-53420729ea164c0cc6244316a3001f64e919dc2c.tar.bz2
- Patch #101927 by cooferat: fixed problem with post information.
-rw-r--r--includes/bootstrap.inc26
-rw-r--r--includes/common.inc2
-rw-r--r--includes/locale.inc2
-rw-r--r--themes/chameleon/chameleon.theme8
4 files changed, 34 insertions, 4 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index a2aa44742..5e7591f2a 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -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));
}
/**
diff --git a/includes/common.inc b/includes/common.inc
index 5bd1ac781..29911dd9e 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -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);
}
diff --git a/includes/locale.inc b/includes/locale.inc
index e0735ce04..49677a8bc 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -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)) {
diff --git a/themes/chameleon/chameleon.theme b/themes/chameleon/chameleon.theme
index 9d8c24f98..aa7405540 100644
--- a/themes/chameleon/chameleon.theme
+++ b/themes/chameleon/chameleon.theme
@@ -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";