Skip to content

Commit

Permalink
Remove unusable option session_handler
Browse files Browse the repository at this point in the history
$g_session_handler has been available for many years, but was never implemented.

Fixes #23966
  • Loading branch information
atrol committed Feb 19, 2018
1 parent 1217a06 commit 1ed490a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 37 deletions.
11 changes: 1 addition & 10 deletions config_defaults_inc.php
Expand Up @@ -269,15 +269,6 @@
# Web Server #
##############

/**
* Session handler. Possible values:
* 'php' -> Default PHP filesystem sessions
* 'adodb' -> Database storage sessions
* 'memcached' -> Memcached storage sessions
* @global string $g_session_handler
*/
$g_session_handler = 'php';

/**
* Session save path. If false, uses default value as set by session handler.
* @global bool $g_session_save_path
Expand Down Expand Up @@ -4334,7 +4325,7 @@
'database_name', 'db_username', 'db_password', 'db_type',
'db_table_prefix','db_table_suffix', 'display_errors', 'form_security_validation',
'hostname','html_valid_tags', 'html_valid_tags_single_line', 'default_language',
'language_auto_map', 'fallback_language', 'login_method', 'plugins_enabled', 'session_handler',
'language_auto_map', 'fallback_language', 'login_method', 'plugins_enabled',
'session_save_path', 'session_validation', 'show_detailed_errors', 'show_queries_count',
'stop_on_errors', 'version_suffix', 'debug_email',
'fileinfo_magic_db_file', 'css_include_file', 'css_rtl_include_file',
Expand Down
3 changes: 3 additions & 0 deletions core/constant_inc.php
Expand Up @@ -422,6 +422,9 @@

# ERROR_SESSION_*
define( 'ERROR_SESSION_HANDLER_INVALID', 2700 );
# ERROR_SESSION_HANDLER_INVALID is no longer used in code
# but can't be removed as long as it's used in one of the language files
# for $MANTIS_ERROR[ERROR_SESSION_HANDLER_INVALID]
define( 'ERROR_SESSION_VAR_NOT_FOUND', 2701 );
define( 'ERROR_SESSION_NOT_VALID', 2702 );

Expand Down
3 changes: 3 additions & 0 deletions core/obsolete.php
Expand Up @@ -217,3 +217,6 @@

# changes in 2.11.0
config_obsolete( 'differentiate_duplicates' );

# changes in 2.12.0
config_obsolete( 'session_handler' );
15 changes: 3 additions & 12 deletions core/session_api.php
Expand Up @@ -184,18 +184,9 @@ function destroy() {
* @return void
*/
function session_init( $p_session_id = null ) {
global $g_session, $g_session_handler;

switch( utf8_strtolower( $g_session_handler ) ) {
case 'php':
$g_session = new MantisPHPSession( $p_session_id );
break;
case 'memcached':
# Not yet implemented
default:
trigger_error( ERROR_SESSION_HANDLER_INVALID, ERROR );
break;
}
global $g_session;

$g_session = new MantisPHPSession( $p_session_id );

if( ON == config_get_global( 'session_validation' ) && session_get( 'secure_session', false ) ) {
session_validate( $g_session );
Expand Down
14 changes: 0 additions & 14 deletions docbook/Admin_Guide/en-US/config/webserver.xml
Expand Up @@ -6,20 +6,6 @@
<title>Webserver</title>

<variablelist>
<varlistentry>
<term>$g_session_handler</term>
<listitem>
<para>Session handler. Possible values are as per the
list below; the default is <emphasis>php</emphasis>.
<itemizedlist>
<listitem><para><emphasis>php</emphasis>: PHP filesystem sessions</para></listitem>
<listitem><para><emphasis>adodb</emphasis>: Database storage sessions</para></listitem>
<listitem><para><emphasis>memcached</emphasis>: Memcached storage sessions</para></listitem>
</itemizedlist>
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>$g_session_save_path</term>
<listitem>
Expand Down
1 change: 0 additions & 1 deletion lang/strings_english.txt
Expand Up @@ -1741,7 +1741,6 @@ $MANTIS_ERROR[ERROR_PLUGIN_INVALID_FILE] = 'The format of the specified plugin f
$MANTIS_ERROR[ERROR_PLUGIN_GENERIC] = 'There was an unknown error "%1$s" during execution of the "%2$s" plugin.';
$MANTIS_ERROR[ERROR_COLUMNS_DUPLICATE] = 'Field "%1$s" contains duplicate column "%2$s".';
$MANTIS_ERROR[ERROR_COLUMNS_INVALID] = 'Field "%1$s" contains invalid field "%2$s".';
$MANTIS_ERROR[ERROR_SESSION_HANDLER_INVALID] = 'Invalid session handler.';
$MANTIS_ERROR[ERROR_SESSION_VAR_NOT_FOUND] = 'Session variable "%1$s" not found.';
$MANTIS_ERROR[ERROR_SESSION_NOT_VALID] = 'Your session has become invalidated.';
$MANTIS_ERROR[ERROR_FORM_TOKEN_INVALID] = 'Invalid form security token. This could be caused by a session timeout, or accidentally submitting the form twice.';
Expand Down

0 comments on commit 1ed490a

Please sign in to comment.