From 0d1785f848295a4701bdc2afbe33ee02991918b2 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Thu, 11 Jun 2009 12:14:15 +0000 Subject: [PATCH] Specific php session checks, if a session has already been issued. --- comment.php | 2 ++ index.php | 1 - .../serendipity_event_livesearch.js | 1 + serendipity_config.inc.php | 9 +++++---- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/comment.php b/comment.php index 05e5be13..eb92e948 100644 --- a/comment.php +++ b/comment.php @@ -2,6 +2,8 @@ # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) # All rights reserved. See LICENSE file for licensing details +#if ($_REQUEST['type'] == 'trackback') die('Disabled'); + include('serendipity_config.inc.php'); include S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php'; diff --git a/index.php b/index.php index e3ffc3ad..47343f9d 100644 --- a/index.php +++ b/index.php @@ -24,7 +24,6 @@ header('Status: 200 OK'); ob_start(); include('serendipity_config.inc.php'); header('Content-Type: text/html; charset='. LANG_CHARSET); - if ($serendipity['expose_s9y']) { header('X-Blog: Serendipity'); // Used for installer detection } diff --git a/plugins/serendipity_event_livesearch/serendipity_event_livesearch.js b/plugins/serendipity_event_livesearch/serendipity_event_livesearch.js index 5be65938..63af2bb2 100644 --- a/plugins/serendipity_event_livesearch/serendipity_event_livesearch.js +++ b/plugins/serendipity_event_livesearch/serendipity_event_livesearch.js @@ -60,6 +60,7 @@ function liveSearchInit() { } function liveSearchKeyPress(event) { + if (!event || typeof(event) == 'undefined' || typeof(event.keyCode) == 'undefined') return; if (event.keyCode == 40 ) { //KEY DOWN highlight = document.getElementById("LSHighlight"); if (!highlight) { diff --git a/serendipity_config.inc.php b/serendipity_config.inc.php index c177f8eb..104ba4fe 100644 --- a/serendipity_config.inc.php +++ b/serendipity_config.inc.php @@ -9,7 +9,10 @@ if (defined('S9Y_FRAMEWORK')) { @define('S9Y_FRAMEWORK', true); if (!headers_sent()) { - session_name('s9y_' . md5(dirname(__FILE__))); + // Only set the session name, if no session has yet been issued. + if (session_id() == '') { + session_name('s9y_' . md5(dirname(__FILE__))); + } session_start(); // Prevent session fixation by only allowing sessions that have been sent by the server. @@ -20,7 +23,7 @@ if (!headers_sent()) { session_regenerate_id(true); @session_start(); header('X-Session-Reinit: true'); - $_SESSION['SERVER_GENERATED_SID'] = true; + $_SESSION['SERVER_GENERATED_SID'] = $_SERVER['REMOTE_ADDR'] . $_SERVER['QUERY_STRING']; } } @@ -152,7 +155,6 @@ if (!isset($serendipity['languages'])) { /* Available Calendars */ $serendipity['calendars'] = array('gregorian' => 'Gregorian', 'persian-utf8' => 'Persian (utf8)'); - /* * Load main language file */ @@ -402,5 +404,4 @@ if (isset($_SESSION['serendipityEmail'])) { $serendipity['email'] = $_SESSION['serendipityEmail']; } serendipity_plugin_api::hook_event('frontend_configure', $serendipity); - /* vim: set sts=4 ts=4 expandtab : */