Browse code

Relocate CHARSET definition back to the languages/en.php file - this makes some legacy modules work without adding a charset definition

Clarissa Walker authored on 2026/09/05 15:51:33
Showing 7 changed files
... ...
@@ -6,8 +6,6 @@
6 6
 // Based on eFiction 1.1
7 7
 // Copyright (C) 2003 by Rebecca Smallwood.
8 8
 // http://efiction.sourceforge.net/
9
-//
10
-// Size fix / UTF-8 feature 2016-05-18
11 9
 // ----------------------------------------------------------------------
12 10
 // LICENSE
13 11
 //
... ...
@@ -23,7 +21,7 @@
23 21
 //
24 22
 // To read the license please visit http://www.gnu.org/copyleft/gpl.html
25 23
 // ----------------------------------------------------------------------
26
-define("_CHARSET", "utf-8");
24
+
27 25
 define("_BASEDIR", "../");
28 26
 include("../config.php");
29 27
 
... ...
@@ -23,8 +23,8 @@
23 23
 //
24 24
 // To read the license please visit http://www.gnu.org/copyleft/gpl.html
25 25
 // ----------------------------------------------------------------------
26
+
26 27
 define("_BASEDIR", "../");
27
-define("_CHARSET", "utf-8");
28 28
 include("../config.php");
29 29
  
30 30
 $settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'");
... ...
@@ -30,7 +30,7 @@ if(isset($_GET['benchmark'])) {
30 30
 $headerSent = false;
31 31
 
32 32
 // Defines the character set for your language/location
33
-define ("_CHARSET", "utf-8");
33
+define ("_HEADERCHARSET", "utf-8");
34 34
 
35 35
 //default values to avoid ajax issue when notice error are on
36 36
 $allowed_tags = '';
... ...
@@ -62,7 +62,7 @@ if(ini_get('register_globals')) {
62 62
 Header('Cache-Control: private, no-cache, must-revalidate, max_age=0, post-check=0, pre-check=0');
63 63
 header ("Pragma: no-cache"); 
64 64
 header ("Expires: 0"); 
65
-header("Content-Type: text/html; charset="._CHARSET);
65
+header("Content-Type: text/html; charset="._HEADERCHARSET);
66 66
 
67 67
 // Locate config.php and set the basedir path
68 68
 $folder_level = "";
... ...
@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 define("_BASEDIR", "../");
3
-define("_CHARSET", "utf-8");
3
+define("_CATCHARSET", "utf-8");
4 4
 
5 5
 include("../config.php");
6 6
  
... ...
@@ -8,7 +8,7 @@ include("../config.php");
8 8
 list($tableprefix, $lang) = dbrow(dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'"));
9 9
 define("TABLEPREFIX", $tableprefix);
10 10
  
11
-header("Content-Type: text/javascript; charset="._CHARSET,true);
11
+header("Content-Type: text/javascript; charset="._CATCHARSET,true);
12 12
 include("../includes/queries.php");
13 13
 
14 14
 $catid = isset($_GET['catid']) && preg_match("/^[0-9]+$/", $_GET['catid']) ? $_GET['catid'] : -1;
... ...
@@ -4,7 +4,7 @@ ini_set('display_startup_errors', 0);
4 4
 error_reporting(-1);
5 5
 
6 6
 define("_BASEDIR", "../");
7
-define("_CHARSET", "utf-8");
7
+define("_USERCHARSET", "utf-8");
8 8
 
9 9
 include("../config.php");
10 10
 list($tableprefix, $language) = dbrow(dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'"));
... ...
@@ -13,7 +13,7 @@ if(file_exists(_BASEDIR."languages/{$language}.php")) include (_BASEDIR."languag
13 13
 else include (_BASEDIR."languages/en.php");
14 14
 include("../includes/queries.php");
15 15
 
16
-header("Content-Type: text/html; charset="._CHARSET);
16
+header("Content-Type: text/html; charset="._USERCHARSET);
17 17
 
18 18
 $users = dbquery("SELECT "._UIDFIELD." as uid, "._PENNAMEFIELD." as username FROM "._AUTHORTABLE." WHERE LOWER(".
19 19
 	_PENNAMEFIELD.") LIKE \"".escapestring($_GET['str'])."%\" ORDER BY username ASC limit 10");
... ...
@@ -1,7 +1,7 @@
1 1
 <?php
2
+// Defines the character set for your language/location
2 3
 
3
-
4
-
4
+define ("_CHARSET", "UTF-8");
5 5
 
6 6
 // Defines the doc type.  Most people will not need to change this.
7 7
 define ("_DOCTYPE", "<!doctype html>");
... ...
@@ -34,7 +34,7 @@ foreach($settings as $var => $val) {
34 34
 }
35 35
 define("TABLEPREFIX", $tableprefix);
36 36
 define("SITEKEY", $sitekey);
37
-define("_CHARSET", "utf-8");
37
+define("_RSSCHARSET", "utf-8");
38 38
 
39 39
   include_once("includes/queries.php");
40 40
   if(file_exists("languages/{$language}.php")) include("languages/{$language}.php");
... ...
@@ -51,7 +51,7 @@ while($rate = dbassoc($ratlist)) {
51 51
 	$ratings[$rate['rid']] = $rate['rating'];
52 52
 }
53 53
 
54
-  $rss="<?xml version=\"1.0\" encoding=\""._CHARSET."\"?>\n"; 
54
+  $rss="<?xml version=\"1.0\" encoding=\""._RSSCHARSET."\"?>\n";
55 55
   $rss.="<rss version=\"2.0\">\n"; 
56 56
   $rss.="<channel>\n"; 
57 57
   $rss.="<copyright>Copyright ".date("Y")."</copyright>\n";