Relocate CHARSET definition back to the languages/en.php file - this makes some legacy modules work without adding a charset definition
--- a/admin/backup.php
+++ b/admin/backup.php
@@ -6,8 +6,6 @@
// Based on eFiction 1.1
// Copyright (C) 2003 by Rebecca Smallwood.
// http://efiction.sourceforge.net/
-//
-// Size fix / UTF-8 feature 2016-05-18
// ----------------------------------------------------------------------
// LICENSE
//
@@ -23,7 +21,7 @@
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------
-define("_CHARSET", "utf-8");
+
define("_BASEDIR", "../");
include("../config.php");
--- a/admin/backup_utf8.php
+++ b/admin/backup_utf8.php
@@ -23,8 +23,8 @@
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------
+
define("_BASEDIR", "../");
-define("_CHARSET", "utf-8");
include("../config.php");
$settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'");
--- a/header.php
+++ b/header.php
@@ -30,7 +30,7 @@
$headerSent = false;
// Defines the character set for your language/location
-define ("_CHARSET", "utf-8");
+define ("_HEADERCHARSET", "utf-8");
//default values to avoid ajax issue when notice error are on
$allowed_tags = '';
@@ -62,7 +62,7 @@
Header('Cache-Control: private, no-cache, must-revalidate, max_age=0, post-check=0, pre-check=0');
header ("Pragma: no-cache");
header ("Expires: 0");
-header("Content-Type: text/html; charset="._CHARSET);
+header("Content-Type: text/html; charset="._HEADERCHARSET);
// Locate config.php and set the basedir path
$folder_level = "";
--- a/includes/categorylist.php
+++ b/includes/categorylist.php
@@ -1,6 +1,6 @@
<?php
define("_BASEDIR", "../");
-define("_CHARSET", "utf-8");
+define("_CATCHARSET", "utf-8");
include("../config.php");
@@ -8,7 +8,7 @@
list($tableprefix, $lang) = dbrow(dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'"));
define("TABLEPREFIX", $tableprefix);
-header("Content-Type: text/javascript; charset="._CHARSET,true);
+header("Content-Type: text/javascript; charset="._CATCHARSET,true);
include("../includes/queries.php");
$catid = isset($_GET['catid']) && preg_match("/^[0-9]+$/", $_GET['catid']) ? $_GET['catid'] : -1;
--- a/includes/userlist.php
+++ b/includes/userlist.php
@@ -4,7 +4,7 @@
error_reporting(-1);
define("_BASEDIR", "../");
-define("_CHARSET", "utf-8");
+define("_USERCHARSET", "utf-8");
include("../config.php");
list($tableprefix, $language) = dbrow(dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'"));
@@ -13,7 +13,7 @@
else include (_BASEDIR."languages/en.php");
include("../includes/queries.php");
-header("Content-Type: text/html; charset="._CHARSET);
+header("Content-Type: text/html; charset="._USERCHARSET);
$users = dbquery("SELECT "._UIDFIELD." as uid, "._PENNAMEFIELD." as username FROM "._AUTHORTABLE." WHERE LOWER(".
_PENNAMEFIELD.") LIKE \"".escapestring($_GET['str'])."%\" ORDER BY username ASC limit 10");
--- a/languages/en.php
+++ b/languages/en.php
@@ -1,7 +1,7 @@
<?php
-
-
-
+// Defines the character set for your language/location
+
+define ("_CHARSET", "UTF-8");
// Defines the doc type. Most people will not need to change this.
define ("_DOCTYPE", "<!doctype html>");
--- a/rss.php
+++ b/rss.php
@@ -34,7 +34,7 @@
}
define("TABLEPREFIX", $tableprefix);
define("SITEKEY", $sitekey);
-define("_CHARSET", "utf-8");
+define("_RSSCHARSET", "utf-8");
include_once("includes/queries.php");
if(file_exists("languages/{$language}.php")) include("languages/{$language}.php");
@@ -51,7 +51,7 @@
$ratings[$rate['rid']] = $rate['rating'];
}
- $rss="<?xml version=\"1.0\" encoding=\""._CHARSET."\"?>\n";
+ $rss="<?xml version=\"1.0\" encoding=\""._RSSCHARSET."\"?>\n";
$rss.="<rss version=\"2.0\">\n";
$rss.="<channel>\n";
$rss.="<copyright>Copyright ".date("Y")."</copyright>\n";