Browse code

fix session.upload_progress.enabled check - always used else statement otherwise

Clarissa Walker authored on 2026/11/21 12:50:04
Showing 1 changed files
... ...
@@ -30,7 +30,8 @@ else $current = "login";
30 30
 	if(!empty($_POST['submit']) && $current == "login") {
31 31
 	// as of CVE-2026-115560, you can no longer set these settings if
32 32
 	// session.upload_progress.enabled is set to 'On'
33
-	if (ini_get('session.upload_progress.enabled' == 0) && (version_compare(PHP_VERSION, '7.3.0', '>='))) {
33
+	$sessionuploadprogress = ini_get('session.upload_progress.enabled');
34
+	if (($sessionuploadprogress != 1) && (version_compare(PHP_VERSION, '7.3.0', '>='))) {
34 35
 		ini_set('session.cookie_httponly', '1');
35 36
 		ini_set('session.cookie_samesite', 'Lax');
36 37
 		session_start();
Browse code

add PHP version check - the samesite session entry was introduced in PHP 7.3.0

Clarissa Walker authored on 2026/11/19 15:21:55
Showing 1 changed files
... ...
@@ -30,7 +30,7 @@ else $current = "login";
30 30
 	if(!empty($_POST['submit']) && $current == "login") {
31 31
 	// as of CVE-2026-115560, you can no longer set these settings if
32 32
 	// session.upload_progress.enabled is set to 'On'
33
-	if (ini_get('session.upload_progress.enabled' == 0)) {
33
+	if (ini_get('session.upload_progress.enabled' == 0) && (version_compare(PHP_VERSION, '7.3.0', '>='))) {
34 34
 		ini_set('session.cookie_httponly', '1');
35 35
 		ini_set('session.cookie_samesite', 'Lax');
36 36
 		session_start();
Browse code

As of CVE-2026-115560, you can no longer set ini session settings when session.upload_progress.enabled is set to 'On', which is... a LOT of PHP configurations - this now brings up an Uncaught Error in patched versions - you would have to explicitly set these in the php.ini config, or change the aforementioned setting to 'Off' - just-released PHP 8.6.0 does set the session cookie settings in these files to what is specified by default

Clarissa Walker authored on 2026/11/19 13:45:07
Showing 1 changed files
... ...
@@ -28,9 +28,14 @@ else $current = "login";
28 28
 	}
29 29
 	
30 30
 	if(!empty($_POST['submit']) && $current == "login") {
31
-	ini_set('session.cookie_httponly', '1');
32
-	ini_set('session.cookie_samesite', 'Lax');
33
-	session_start();
31
+	// as of CVE-2026-115560, you can no longer set these settings if
32
+	// session.upload_progress.enabled is set to 'On'
33
+	if (ini_get('session.upload_progress.enabled' == 0)) {
34
+		ini_set('session.cookie_httponly', '1');
35
+		ini_set('session.cookie_samesite', 'Lax');
36
+		session_start();
37
+	}
38
+	else session_start();
34 39
 	define("_LOGINCHECK", true);		
35 40
 		include("user/login.php");
36 41
 	}
Browse code

header.php, user.php, user/login.php: Security - Session and Remember Me cookies are now marked httponly and Lax, previously nonexistent - from @ariadoss

Clarissa Walker authored on 2026/10/26 21:25:45
Showing 1 changed files
... ...
@@ -28,6 +28,8 @@ else $current = "login";
28 28
 	}
29 29
 	
30 30
 	if(!empty($_POST['submit']) && $current == "login") {
31
+	ini_set('session.cookie_httponly', '1');
32
+	ini_set('session.cookie_samesite', 'Lax');
31 33
 	session_start();
32 34
 	define("_LOGINCHECK", true);		
33 35
 		include("user/login.php");
Browse code

admin.php, browse.php, user.php, includes/get_session_vars.php: Security - SQL injection patches - from @ariadoss

Clarissa Walker authored on 2026/10/26 13:11:20
Showing 1 changed files
... ...
@@ -56,7 +56,7 @@ if((empty($action) || $action == "login") && isMEMBER) {
56 56
 	$output .= "</div>\n";
57 57
 }
58 58
 else if(!empty($action)) {
59
-	$panelquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_name = '$action' AND (panel_type='U' ".(!$submissionsoff || isADMIN ? " OR panel_type = 'S'" : "").($favorites ? " OR panel_type = 'F'" : "").") LIMIT 1");
59
+	$panelquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_name = '".escapestring($action)."' AND (panel_type='U' ".(!$submissionsoff || isADMIN ? " OR panel_type = 'S'" : "").($favorites ? " OR panel_type = 'F'" : "").") LIMIT 1");
60 60
 	if(dbnumrows($panelquery)) {
61 61
 		$panel = dbassoc($panelquery);
62 62
 		if($panel['panel_level'] > 0 && !isMEMBER) accessDenied( );
... ...
@@ -70,4 +70,4 @@ else $output = write_error(_NOTAUTHORIZED);
70 70
 $tpl->assign( "output", $output );
71 71
 $tpl->printToScreen();
72 72
 dbclose( );
73
-?>
74 73
\ No newline at end of file
74
+?>
Browse code

3.5.6 efiction version

Jimako authored on 2024/03/09 16:09:42
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,73 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// Copyright (c) 2007 by Tammy Keefer
4
+// Based on eFiction 1.1
5
+// Copyright (C) 2003 by Rebecca Smallwood.
6
+// http://efiction.sourceforge.net/
7
+// ----------------------------------------------------------------------
8
+// LICENSE
9
+//
10
+// This program is free software; you can redistribute it and/or
11
+// modify it under the terms of the GNU General Public License (GPL)
12
+// as published by the Free Software Foundation; either version 2
13
+// of the License, or (at your option) any later version.
14
+//
15
+// This program is distributed in the hope that it will be useful,
16
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+// GNU General Public License for more details.
19
+//
20
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
21
+// ----------------------------------------------------------------------
22
+if(isset($_GET['action'])) $current = $_GET['action'];
23
+else $current = "login";
24
+
25
+	if($current == "logout" ) {
26
+		define("_LOGOUTCHECK", true);		
27
+		include("user/logout.php");
28
+	}
29
+	
30
+	if(!empty($_POST['submit']) && $current == "login") {
31
+	session_start();
32
+	define("_LOGINCHECK", true);		
33
+		include("user/login.php");
34
+	}
35
+
36
+require_once("header.php");
37
+//make a new TemplatePower object
38
+if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
39
+else $tpl = new TemplatePower("default_tpls/default.tpl");
40
+if(file_exists("$skindir/listings.tpl")) $tpl->assignInclude( "listings", "./$skindir/listings.tpl" );
41
+else $tpl->assignInclude( "listings", "./default_tpls/listings.tpl" );
42
+include("includes/pagesetup.php");
43
+
44
+if($action) $current = $action;
45
+else $current = "user";
46
+// end main function 
47
+if((empty($action) || $action == "login") && isMEMBER) {
48
+	$output .= "<div id=\"pagetitle\">"._USERACCOUNT."</div>
49
+		<div class=\"tblborder\" id=\"useropts\" style=\"padding: 5px; width: 50%; margin: 1em 25%;\">";
50
+	$panelquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_hidden != '1' AND panel_level = '1' AND (panel_type = 'U' ".(!$submissionsoff || isADMIN ? " OR panel_type = 'S'" : "").($favorites ? " OR panel_type = 'F'" : "").") ORDER BY panel_type, panel_order, panel_title ASC");
51
+	if(!dbnumrows($panelquery)) $output .= _FATALERROR;
52
+	while($panel = dbassoc($panelquery)) {
53
+		if(!$panel['panel_url']) $output .=  "<a href=\"user.php?action=".$panel['panel_name']."\">".$panel['panel_title']."</a><br />\n";
54
+		else $output .= "<a href=\"".$panel['panel_url']."\">".$panel['panel_title']."</a><br />\n";
55
+	}
56
+	$output .= "</div>\n";
57
+}
58
+else if(!empty($action)) {
59
+	$panelquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_name = '$action' AND (panel_type='U' ".(!$submissionsoff || isADMIN ? " OR panel_type = 'S'" : "").($favorites ? " OR panel_type = 'F'" : "").") LIMIT 1");
60
+	if(dbnumrows($panelquery)) {
61
+		$panel = dbassoc($panelquery);
62
+		if($panel['panel_level'] > 0 && !isMEMBER) accessDenied( );
63
+		if($panel['panel_url'] && file_exists(_BASEDIR.$panel['panel_url'])) require_once(_BASEDIR.$panel['panel_url']);
64
+		else if(file_exists("user/{$action}.php")) require_once("user/{$action}.php");
65
+		else $output = write_error(_ERROR);
66
+	}
67
+	else $output .= write_error(_ERROR);
68
+}
69
+else $output = write_error(_NOTAUTHORIZED);
70
+$tpl->assign( "output", $output );
71
+$tpl->printToScreen();
72
+dbclose( );
73
+?>
0 74
\ No newline at end of file