diff options
| author | WubTheCaptain <wub@partyvan.eu> | 2015-09-21 07:26:20 +0200 |
|---|---|---|
| committer | WubTheCaptain <wub@partyvan.eu> | 2015-09-21 07:26:20 +0200 |
| commit | 0b5b8136066f50521ad66cb34d81164882042b4f (patch) | |
| tree | 3fb24cf23205d0715285f75e7b0a1c0abae1d14c | |
| parent | 504020ae149dfe3ce0ee35b32ef739aa0bd88a34 (diff) | |
Clean up HTML response construct, uppercase UTF-8
IANA has registered UTF-8 as uppercase, hyphenated. The RFC concerning
UTF-8, RFC 3629 also uses this grammar.
RFC 2231 says the Content-Type charset value should be:
charset := <registered character set name>
RFC 5987 further emphasizes this:
charset = "UTF-8" / "ISO-8859-1" / mime-charset
Therefore lowercase "utf-8" in Content-Type responses is technically
incorrect, but case-insensitive according to RFC 2616.
Thanks to pantsucat for researching this with me.
| -rwxr-xr-x | static/classes/Response.class.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/static/classes/Response.class.php b/static/classes/Response.class.php index b7e4c5d..037d94f 100755 --- a/static/classes/Response.class.php +++ b/static/classes/Response.class.php @@ -16,10 +16,9 @@ class Response header('Content-Type: text/plain; charset=UTF-8'); $this->type = $response_type; break; - case 'html': - header('Content-Type: text/html;charset=utf-8'); - $this->type = 'html'; + header('Content-Type: text/html; charset=UTF-8'); + $this->type = $response_type; break; default: header('Content-Type: application/json; charset=UTF-8'); @@ -107,6 +106,7 @@ class Response { return POMF_URL.$files[0]['url']; } + private static function txt_error($code, $description) { return 'ERROR: ('.$code.') '.$description; |
