Browse code

includes/characterlist.php: revert - move to patch includes/storyform.php

Clarissa Walker authored on 2026/11/12 13:51:57
Showing 1 changed files
... ...
@@ -7,16 +7,6 @@ include(_BASEDIR."languages/$lang.php");
7 7
 //header("Content-Type: text/html; charset=".CHARSET,true);
8 8
 include("../includes/queries.php");
9 9
 // Checks that the given $num is actually a number.  Used to help prevent XSS attacks.
10
-// Peculiar... Leaving both copies of the same exact function in this file prevents
11
-// breakage of the character list when using the category list for tinyMCE 4.x and newer...
12
-function isNumber($num) {
13
-	if(empty($num)) return false;
14
-	return (preg_match("/^[0-9]+$/", $num) || $num == "-1" ? true : false);
15
-}
16
-
17
-// Checks that the given $num is actually a number.  Used to help prevent XSS attacks.
18
-// Peculiar... Leaving both copies of the same exact function in this file prevents
19
-// breakage of the character list when using the category list for tinyMCE 4.x and newer...
20 10
 function isNumber($num) {
21 11
 	if(empty($num)) return false;
22 12
 	return (preg_match("/^[0-9]+$/", $num) || $num == "-1" ? true : false);
Browse code

includes/characterlist.php: PHP 8.x warning fix - from upstream

Clarissa Walker authored on 2026/11/12 10:26:59
Showing 1 changed files
... ...
@@ -25,7 +25,8 @@ function isNumber($num) {
25 25
 $catid = isset($_GET['catid']) ? explode(",", $_GET['catid']) : array(-1);
26 26
 $catid = array_filter($catid, "isNumber");
27 27
 $characters = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_characters WHERE ".(count($catid) > 1 ? "FIND_IN_SET(catid, '".implode(",", $catid)."') > 0" : "catid = '".$catid[0]."'")." ORDER BY charname");
28
-echo "var element = '".$_GET['element']."';\n";
28
+if(!isset($_GET['element']) || !preg_match('/^[A-Za-z_][A-Za-z0-9_.-]*$/', $_GET['element'])) $_GET['element'] = '';
29
+echo "var element = '".addslashes($_GET['element'])."';\n";
29 30
 $x = 0;
30 31
 $find = array ('"', chr(150), chr(147), chr(148), chr(146));
31 32
 $replace = array ('\"', "-", "\"", "\"", "'");
Browse code

includes/characterlist.php: Somehow having two copies of the same exact function stops the character list from bugging out when using the category list while using tinyMCE 4.x or newer - also somehow no PHP errors, either...

Clarissa Walker authored on 2026/11/10 20:48:51
Showing 1 changed files
... ...
@@ -7,6 +7,16 @@ include(_BASEDIR."languages/$lang.php");
7 7
 //header("Content-Type: text/html; charset=".CHARSET,true);
8 8
 include("../includes/queries.php");
9 9
 // Checks that the given $num is actually a number.  Used to help prevent XSS attacks.
10
+// Peculiar... Leaving both copies of the same exact function in this file prevents
11
+// breakage of the character list when using the category list for tinyMCE 4.x and newer...
12
+function isNumber($num) {
13
+	if(empty($num)) return false;
14
+	return (preg_match("/^[0-9]+$/", $num) || $num == "-1" ? true : false);
15
+}
16
+
17
+// Checks that the given $num is actually a number.  Used to help prevent XSS attacks.
18
+// Peculiar... Leaving both copies of the same exact function in this file prevents
19
+// breakage of the character list when using the category list for tinyMCE 4.x and newer...
10 20
 function isNumber($num) {
11 21
 	if(empty($num)) return false;
12 22
 	return (preg_match("/^[0-9]+$/", $num) || $num == "-1" ? true : false);
Browse code

Add includes/dbfunctions.php include back to config.php, but leave the actual dbconnect in the includes/dbfunctions.php file where it belongs - this makes legacy modules work without adding another include

Clarissa Walker authored on 2026/09/05 13:38:55
Showing 1 changed files
... ...
@@ -1,7 +1,6 @@
1 1
 <?php
2 2
 define("_BASEDIR", "../");
3 3
 include("../config.php");
4
-include("../includes/dbfunctions.php");
5 4
 list($tableprefix, $lang) = dbrow(dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'"));
6 5
 define("TABLEPREFIX", $tableprefix);
7 6
 include(_BASEDIR."languages/$lang.php");
Browse code

version 3.5.7

Jimako authored on 2024/04/08 12:21:57
Showing 1 changed files
... ...
@@ -21,7 +21,7 @@ $x = 0;
21 21
 $find = array ('"', chr(150), chr(147), chr(148), chr(146));
22 22
 $replace = array ('\"', "-", "\"", "\"", "'");
23 23
 while($char = dbassoc($characters)) {
24
-	echo "characters[$x] = new Array(".$char['charid'].", \"".urlencode(str_replace($find, $replace, stripslashes($char['charname'])))."\");\r\n";
24
+	echo "characters[$x] = new Array(".$char['charid'].", \"". str_replace($find, $replace, stripslashes($char['charname'])) ."\");\r\n";
25 25
 	$x++;
26 26
 }
27
-?>
28 27
\ No newline at end of file
28
+?>
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,27 @@
1
+<?php
2
+define("_BASEDIR", "../");
3
+include("../config.php");
4
+include("../includes/dbfunctions.php");
5
+list($tableprefix, $lang) = dbrow(dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'"));
6
+define("TABLEPREFIX", $tableprefix);
7
+include(_BASEDIR."languages/$lang.php");
8
+//header("Content-Type: text/html; charset=".CHARSET,true);
9
+include("../includes/queries.php");
10
+// Checks that the given $num is actually a number.  Used to help prevent XSS attacks.
11
+function isNumber($num) {
12
+	if(empty($num)) return false;
13
+	return (preg_match("/^[0-9]+$/", $num) || $num == "-1" ? true : false);
14
+}
15
+
16
+$catid = isset($_GET['catid']) ? explode(",", $_GET['catid']) : array(-1);
17
+$catid = array_filter($catid, "isNumber");
18
+$characters = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_characters WHERE ".(count($catid) > 1 ? "FIND_IN_SET(catid, '".implode(",", $catid)."') > 0" : "catid = '".$catid[0]."'")." ORDER BY charname");
19
+echo "var element = '".$_GET['element']."';\n";
20
+$x = 0;
21
+$find = array ('"', chr(150), chr(147), chr(148), chr(146));
22
+$replace = array ('\"', "-", "\"", "\"", "'");
23
+while($char = dbassoc($characters)) {
24
+	echo "characters[$x] = new Array(".$char['charid'].", \"".urlencode(str_replace($find, $replace, stripslashes($char['charname'])))."\");\r\n";
25
+	$x++;
26
+}
27
+?>
0 28
\ No newline at end of file