This commit has been accessed 674 times via Git panel.
commit bf3c455dfd887ad5f0f0c521a771ecdd010226b5
tree 44ca46d08227f1cbbd5d372aade9996311e69270
parent 5a5d1951cecfd4946391b5942b070aca9c30e2ed
author Engels Antonio <engels@majcms.org> 1310742391 +0800
committer Engels Antonio <engels@majcms.org> 1310742391 +0800
Add UTF-8 headers
diff --git a/core.php b/core.php
index eab0489..a663636 100644
--- a/core.php
+++ b/core.php
@@ -1,5 +1,22 @@
<?php
+header('Content-Type: text/html; charset=UTF-8');
+header('Cache-Control: private');
+
+ini_set("session.use_trans_sid","0");
+ini_set("mbstring.language","Neutral");
+ini_set("mbstring.internal_encoding","UTF-8");
+ini_set("mbstring.encoding_translation","On");
+ini_set("mbstring.http_input","auto");
+ini_set("mbstring.http_output","UTF-8");
+ini_set("mbstring.detect_order","auto");
+ini_set("mbstring.substitute_character","none");
+ini_set("default_charset","UTF-8");
+
+error_reporting(E_ERROR);
+
+session_start();
+
if (isset($_POST['mbox_min']) and !empty($_POST['mbox_min']) and is_numeric($_POST['mbox_min'])) {
$mbox_min = $_POST['mbox_min'];
}
diff --git a/index.php b/index.php
index 56671eb..860bcb6 100644
--- a/index.php
+++ b/index.php
@@ -11,8 +11,6 @@ $mail_root = "/var/spool/kartero";
/* feel free to hack the succeeding code to suit your needs (basic php and mysql skills required) */
-session_start();
-
require_once("core.php");
function rmdirr($recurse_dirname) {
@@ -172,7 +170,7 @@ if (!isset($_SESSION['logged_uid']) and (($pw_put != $pw_get) or !isset($_POST['
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\">";
echo "<form method=\"post\">";
echo "<tr bgcolor=\"#ffffff\"><td><select class=\"input\" name=\"lvl\"><option value=\"subscriber\">subscriber</option><option value=\"postmaster\">postmaster</option><option value=\"administrator\">administrator</option></select></td></tr>";
- echo "<tr bgcolor=\"#ffffff\"><td><input required class=\"input\" type=\"text\" name=\"id\" autocomplete=\"off\" maxlength=\"128\"></td></tr>";
+ echo "<tr bgcolor=\"#ffffff\"><td><input required autofocus class=\"input\" type=\"text\" name=\"id\" autocomplete=\"off\" maxlength=\"128\"></td></tr>";
echo "<tr bgcolor=\"#ffffff\"><td><input required class=\"input\" type=\"password\" name=\"pw\" autocomplete=\"off\" maxlength=\"64\"></td></tr>";
echo "<tr bgcolor=\"#ffffff\"><td><input class=\"button\" type=\"submit\" value=\"login\"></td></tr>";
echo "</form>";
diff --git a/post.php b/post.php
index 81751d0..6ad7dec 100644
--- a/post.php
+++ b/post.php
@@ -44,7 +44,7 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
mysql_free_result($post_alias_query);
- echo "<tr><td><b>To:</b></td><td><input required class=\"input\" type=\"text\" name=\"reply_to\"></td></tr>";
+ echo "<tr><td><b>To:</b></td><td><input required autofocus class=\"input\" type=\"text\" name=\"reply_to\"></td></tr>";
echo "<tr><td><b>Cc:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_cc\"></td></tr>";
echo "<tr><td><b>Bcc:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_bcc\"></td></tr>";
echo "<tr><td><b>Subject:</b></td><td><input required class=\"input\" type=\"text\" name=\"reply_subj\"></td></tr>";
tree 44ca46d08227f1cbbd5d372aade9996311e69270
parent 5a5d1951cecfd4946391b5942b070aca9c30e2ed
author Engels Antonio <engels@majcms.org> 1310742391 +0800
committer Engels Antonio <engels@majcms.org> 1310742391 +0800
Add UTF-8 headers
diff --git a/core.php b/core.php
index eab0489..a663636 100644
--- a/core.php
+++ b/core.php
@@ -1,5 +1,22 @@
<?php
+header('Content-Type: text/html; charset=UTF-8');
+header('Cache-Control: private');
+
+ini_set("session.use_trans_sid","0");
+ini_set("mbstring.language","Neutral");
+ini_set("mbstring.internal_encoding","UTF-8");
+ini_set("mbstring.encoding_translation","On");
+ini_set("mbstring.http_input","auto");
+ini_set("mbstring.http_output","UTF-8");
+ini_set("mbstring.detect_order","auto");
+ini_set("mbstring.substitute_character","none");
+ini_set("default_charset","UTF-8");
+
+error_reporting(E_ERROR);
+
+session_start();
+
if (isset($_POST['mbox_min']) and !empty($_POST['mbox_min']) and is_numeric($_POST['mbox_min'])) {
$mbox_min = $_POST['mbox_min'];
}
diff --git a/index.php b/index.php
index 56671eb..860bcb6 100644
--- a/index.php
+++ b/index.php
@@ -11,8 +11,6 @@ $mail_root = "/var/spool/kartero";
/* feel free to hack the succeeding code to suit your needs (basic php and mysql skills required) */
-session_start();
-
require_once("core.php");
function rmdirr($recurse_dirname) {
@@ -172,7 +170,7 @@ if (!isset($_SESSION['logged_uid']) and (($pw_put != $pw_get) or !isset($_POST['
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\">";
echo "<form method=\"post\">";
echo "<tr bgcolor=\"#ffffff\"><td><select class=\"input\" name=\"lvl\"><option value=\"subscriber\">subscriber</option><option value=\"postmaster\">postmaster</option><option value=\"administrator\">administrator</option></select></td></tr>";
- echo "<tr bgcolor=\"#ffffff\"><td><input required class=\"input\" type=\"text\" name=\"id\" autocomplete=\"off\" maxlength=\"128\"></td></tr>";
+ echo "<tr bgcolor=\"#ffffff\"><td><input required autofocus class=\"input\" type=\"text\" name=\"id\" autocomplete=\"off\" maxlength=\"128\"></td></tr>";
echo "<tr bgcolor=\"#ffffff\"><td><input required class=\"input\" type=\"password\" name=\"pw\" autocomplete=\"off\" maxlength=\"64\"></td></tr>";
echo "<tr bgcolor=\"#ffffff\"><td><input class=\"button\" type=\"submit\" value=\"login\"></td></tr>";
echo "</form>";
diff --git a/post.php b/post.php
index 81751d0..6ad7dec 100644
--- a/post.php
+++ b/post.php
@@ -44,7 +44,7 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
mysql_free_result($post_alias_query);
- echo "<tr><td><b>To:</b></td><td><input required class=\"input\" type=\"text\" name=\"reply_to\"></td></tr>";
+ echo "<tr><td><b>To:</b></td><td><input required autofocus class=\"input\" type=\"text\" name=\"reply_to\"></td></tr>";
echo "<tr><td><b>Cc:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_cc\"></td></tr>";
echo "<tr><td><b>Bcc:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_bcc\"></td></tr>";
echo "<tr><td><b>Subject:</b></td><td><input required class=\"input\" type=\"text\" name=\"reply_subj\"></td></tr>";