From fe7618f1baf08fe8f579b2efdbb7e5200b60e6d4 Mon Sep 17 00:00:00 2001
From: till <till@php.net>
Date: Wed, 22 Oct 2008 10:18:47 -0400
Subject: [PATCH] * checking if a user session is active in quotaimg.php * this is an expensive operation * but it fixes a possible DoS * implement max-width and -height for the image (subject to change)
---
program/lib/utf8.class.php | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/program/lib/utf8.class.php b/program/lib/utf8.class.php
index 57126a7..e2d1059 100644
--- a/program/lib/utf8.class.php
+++ b/program/lib/utf8.class.php
@@ -1,4 +1,4 @@
-<?
+<?php
/*
utf8 1.0
Copyright: Left
@@ -50,7 +50,15 @@
"ISO-8859-1" => UTF8_MAP_DIR . "/ISO-8859-1.map",
"ISO-8859-2" => UTF8_MAP_DIR . "/ISO-8859-2.map",
"ISO-8859-3" => UTF8_MAP_DIR . "/ISO-8859-3.map",
- "ISO-8859-4" => UTF8_MAP_DIR . "/ISO-8859-4.map");
+ "ISO-8859-4" => UTF8_MAP_DIR . "/ISO-8859-4.map",
+ "ISO-8859-5" => UTF8_MAP_DIR . "/ISO-8859-5.map",
+ "ISO-8859-6" => UTF8_MAP_DIR . "/ISO-8859-6.map",
+ "ISO-8859-7" => UTF8_MAP_DIR . "/ISO-8859-7.map",
+ "ISO-8859-8" => UTF8_MAP_DIR . "/ISO-8859-8.map",
+ "ISO-8859-9" => UTF8_MAP_DIR . "/ISO-8859-9.map",
+ "KOI8-R" => UTF8_MAP_DIR . "/KOI8R.map",
+ "KOI8R" => UTF8_MAP_DIR . "/KOI8R.map"
+ );
//Error constants
define("ERR_OPEN_MAP_FILE","ERR_OPEN_MAP_FILE");
@@ -58,24 +66,18 @@
//Class definition
Class utf8{
- var $charset = CP1250;
+ var $charset = "ISO-8859-1";
var $ascMap = array();
var $utfMap = array();
-
- // made PHP5 capable by RoundCube
+
function __construct($charset="ISO-8859-1"){
$this->loadCharset($charset);
}
- //Constructor
- function utf8($charset="ISO-8859-1"){
- $this->__construct($charset);
- }
-
//Load charset
function loadCharset($charset){
global $utf8_maps;
-
+
if (!is_file($utf8_maps[$charset]))
{
$this->onError(ERR_OPEN_MAP_FILE, "Failed to open map file for $charset");
@@ -170,4 +172,5 @@
}
}
-?>
+
+?>
\ No newline at end of file
--
Gitblit v1.9.1