Specific php session checks, if a session has already been issued.

This commit is contained in:
Garvin Hicking 2009-06-11 12:14:15 +00:00
parent c67a81265f
commit 0d1785f848
4 changed files with 8 additions and 5 deletions

View File

@ -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';

View File

@ -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
}

View File

@ -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) {

View File

@ -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 : */