diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php
index 111f37e438..e5bf4b17d9 100644
--- a/phpgwapi/inc/class.html.inc.php
+++ b/phpgwapi/inc/class.html.inc.php
@@ -1,7 +1,7 @@
*
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
@@ -27,7 +27,7 @@
list(,$this->user_agent,$this->ua_version) = $parts;
$this->user_agent = strtolower($this->user_agent);
- $this->prefered_img_title = $this->user_agent == 'mozilla' && $this->ua_version < 5 ? 'ALT' : 'TITLE';
+ $this->prefered_img_title = $this->user_agent == 'mozilla' && $this->ua_version < 5 ? 'alt' : 'title';
//echo "
HTTP_USER_AGENT='$GLOBALS[HTTP_USER_AGENT]', UserAgent: '$this->user_agent', Version: '$this->ua_version', img_title: '$this->prefered_img_title'
\n";
$this->document_root = $_SERVER['DOCUMENT_ROOT'];
@@ -37,6 +37,16 @@
$this->document_root = '/' . $this->document_root;
}
//echo "_SERVER[DOCUMENT_ROOT]='$_SERVER[DOCUMENT_ROOT]', this->document_root='$this->document_root'
\n";
+
+ if ($GLOBALS['phpgw']->translation)
+ {
+ $this->charset = $GLOBALS['phpgw']->translation->charset();
+ }
+ }
+
+ function htmlspecialchars($str)
+ {
+ return htmlspecialchars($str,ENT_COMPAT,$this->charset);
}
/*
@@ -58,7 +68,7 @@
}
if ((int)$multiple > 0)
{
- $options .= ' MULTIPLE SIZE="'.(int)$multiple.'"';
+ $options .= ' multiple size="'.(int)$multiple.'"';
if (substr($name,-2) != '[]')
{
$name .= '[]';
@@ -72,11 +82,11 @@
}
foreach($arr as $k => $text)
{
- $out .= '\n";
}
@@ -87,7 +97,7 @@
function div($content,$options='')
{
- return "\n$content
\n";
+ return "\n$content
\n";
}
function input_hidden($vars,$value='',$ignore_empty=True)
@@ -104,7 +114,7 @@
}
if (!$ignore_empty || $value && !($name == 'filter' && $value == 'none')) // dont need to send all the empty vars
{
- $html .= "\n";
+ $html .= "htmlspecialchars($value)."\" />\n";
}
}
return $html;
@@ -112,32 +122,32 @@
function textarea($name,$value='',$options='' )
{
- return "\n";
+ return "\n";
}
function input($name,$value='',$type='',$options='' )
{
if ($type)
{
- $type = 'TYPE="'.$type.'"';
+ $type = 'type="'.$type.'"';
}
- return "\n";
+ return "htmlspecialchars($value)."\" $options />\n";
}
function submit_button($name,$lang,$onClick='',$no_lang=0,$options='',$image='',$app='')
{
if ($image != '')
{
- if (strpos($image,'.'))
+ if (strpos($image,'.'))
{
$image = substr($image,0,strpos($image,'.'));
}
if (!($path = $GLOBALS['phpgw']->common->image($app,$image)) &&
- !($path = $GLOBALS['phpgw']->common->image('phpgwapi',$image)))
+ !($path = $GLOBALS['phpgw']->common->image('phpgwapi',$image)))
{
- $path = $image; // name may already contain absolut path
+ $path = $image; // name may already contain absolut path
}
- $image = ' SRC="'.$path.'"';
+ $image = ' src="'.$path.'"';
}
if (!$no_lang)
{
@@ -148,20 +158,20 @@
{
$lang_u = str_replace('&'.$accesskey[1],''.$accesskey[1].'',$lang);
$lang = str_replace('&','',$lang);
- $options = 'ACCESSKEY="'.$accesskey[1].'" '.$options;
+ $options = 'accesskey="'.$accesskey[1].'" '.$options;
}
else
{
$accesskey = '';
$lang_u = $lang;
}
- if ($onClick) $options .= " onClick=\"$onClick\"";
+ if ($onClick) $options .= " onclick=\"$onClick\"";
//