1
0

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 6f434aa3c0
commit 1943a9b2bb
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) # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details # All rights reserved. See LICENSE file for licensing details
#if ($_REQUEST['type'] == 'trackback') die('Disabled');
include('serendipity_config.inc.php'); include('serendipity_config.inc.php');
include S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php'; include S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';

View File

@ -24,7 +24,6 @@ header('Status: 200 OK');
ob_start(); ob_start();
include('serendipity_config.inc.php'); include('serendipity_config.inc.php');
header('Content-Type: text/html; charset='. LANG_CHARSET); header('Content-Type: text/html; charset='. LANG_CHARSET);
if ($serendipity['expose_s9y']) { if ($serendipity['expose_s9y']) {
header('X-Blog: Serendipity'); // Used for installer detection header('X-Blog: Serendipity'); // Used for installer detection
} }

View File

@ -60,6 +60,7 @@ function liveSearchInit() {
} }
function liveSearchKeyPress(event) { function liveSearchKeyPress(event) {
if (!event || typeof(event) == 'undefined' || typeof(event.keyCode) == 'undefined') return;
if (event.keyCode == 40 ) { //KEY DOWN if (event.keyCode == 40 ) { //KEY DOWN
highlight = document.getElementById("LSHighlight"); highlight = document.getElementById("LSHighlight");
if (!highlight) { if (!highlight) {

View File

@ -9,7 +9,10 @@ if (defined('S9Y_FRAMEWORK')) {
@define('S9Y_FRAMEWORK', true); @define('S9Y_FRAMEWORK', true);
if (!headers_sent()) { 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(); session_start();
// Prevent session fixation by only allowing sessions that have been sent by the server. // 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_regenerate_id(true);
@session_start(); @session_start();
header('X-Session-Reinit: true'); 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 */ /* Available Calendars */
$serendipity['calendars'] = array('gregorian' => 'Gregorian', $serendipity['calendars'] = array('gregorian' => 'Gregorian',
'persian-utf8' => 'Persian (utf8)'); 'persian-utf8' => 'Persian (utf8)');
/* /*
* Load main language file * Load main language file
*/ */
@ -402,5 +404,4 @@ if (isset($_SESSION['serendipityEmail'])) {
$serendipity['email'] = $_SESSION['serendipityEmail']; $serendipity['email'] = $_SESSION['serendipityEmail'];
} }
serendipity_plugin_api::hook_event('frontend_configure', $serendipity); serendipity_plugin_api::hook_event('frontend_configure', $serendipity);
/* vim: set sts=4 ts=4 expandtab : */ /* vim: set sts=4 ts=4 expandtab : */