Properly set the encoding to UTF-8 on all HTML pages (#1467)

This adds the BOM to all HTTP pages as per the HTML5 spec and ensures
all pages use UTF-8 as their meta charset (which is still kept for
compatibility with older browsers).
This commit is contained in:
Ben Davies 2020-02-23 04:13:56 -04:00 committed by GitHub
parent e4e55fbeb9
commit e3fcaa492c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 17 additions and 15 deletions

View File

@ -10,7 +10,7 @@ License: GPLv2 or later
error_reporting(E_ALL); error_reporting(E_ALL);
if (@$_GET['act'] === 'dlteam') { if (@$_GET['act'] === 'dlteam') {
header("Content-Type: text/plain"); header("Content-Type: text/plain; charset=utf-8");
if (substr(@$_SERVER['HTTP_REFERER'], 0, 32) !== 'https://play.pokemonshowdown.com') { if (substr(@$_SERVER['HTTP_REFERER'], 0, 32) !== 'https://play.pokemonshowdown.com') {
// since this is only to support Chrome on HTTPS, we can get away with a very specific referer check // since this is only to support Chrome on HTTPS, we can get away with a very specific referer check
die("access denied"); die("access denied");

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<meta charset="utf-8" /> <meta charset="UTF-8" />
<script src="/js/lib/jquery-2.1.4.min.js"></script> <script src="/js/lib/jquery-2.1.4.min.js"></script>
<script> <script>

View File

@ -1,4 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<meta charset="UTF-8" />
<script> <script>
var gui = require('nw.gui'); var gui = require('nw.gui');
var win = gui.Window.get(); var win = gui.Window.get();

View File

@ -1,4 +1,4 @@
<!DOCTYPE html> <!DOCTYPE html>
<!-- <!--
............. .............
,................... ,...................
@ -24,7 +24,7 @@ Also visit us in the Dev chatroom:
https://psim.us/dev https://psim.us/dev
--> -->
<meta charset="utf-8" /> <meta charset="UTF-8" />
<meta id="viewport" name="viewport" content="width=device-width" /> <meta id="viewport" name="viewport" content="width=device-width" />
<title>Showdown!</title> <title>Showdown!</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta http-equiv="X-UA-Compatible" content="IE=Edge" />

View File

@ -1,6 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html><head> <html><head>
<meta charset="utf-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<title>Showdown!</title> <title>Showdown!</title>
<link rel="shortcut icon" href="favicon.ico" id="dynamic-favicon" /> <link rel="shortcut icon" href="favicon.ico" id="dynamic-favicon" />

View File

@ -1,4 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<meta charset="UTF-8" />
<script> <script>
Config = {}; Config = {};
exports = window; exports = window;

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<meta charset="utf-8" /> <meta charset="UTF-8" />
<link rel="stylesheet" href="battle.css" /> <link rel="stylesheet" href="battle.css" />

View File

@ -1,6 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html><head> <html><head>
<meta charset="utf-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<title>Showdown!</title> <title>Showdown!</title>
<link rel="shortcut icon" href="favicon.ico" id="dynamic-favicon" /> <link rel="shortcut icon" href="favicon.ico" id="dynamic-favicon" />

View File

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="UTF-8" />
<meta id="viewport" name="viewport" content="width=device-width" /> <meta id="viewport" name="viewport" content="width=device-width" />
<title>Showdown!</title> <title>Showdown!</title>
<link rel="shortcut icon" href="favicon.ico" id="dynamic-favicon" /> <link rel="shortcut icon" href="favicon.ico" id="dynamic-favicon" />