forked from extern/egroupware
missing stripslashed added to read, common array $maybe_slashes with fields that may contain slashes for read+write
This commit is contained in:
parent
fed982b4a3
commit
f05dc3d53d
@ -19,7 +19,9 @@
|
|||||||
var $grants;
|
var $grants;
|
||||||
var $data = array( );
|
var $data = array( );
|
||||||
var $filters = array( );
|
var $filters = array( );
|
||||||
|
var $maybe_slashes = array (
|
||||||
|
'info_des'=>1,'info_subject'=>1,'info_from'=>1,'info_addr'=>1
|
||||||
|
);
|
||||||
function soinfolog( $info_id = 0)
|
function soinfolog( $info_id = 0)
|
||||||
{
|
{
|
||||||
global $phpgw;
|
global $phpgw;
|
||||||
@ -197,6 +199,11 @@
|
|||||||
if ($info_id != $this->data['info_id']) // data yet read in
|
if ($info_id != $this->data['info_id']) // data yet read in
|
||||||
{
|
{
|
||||||
$this->data = $this->db->Record;
|
$this->data = $this->db->Record;
|
||||||
|
reset($this->maybe_slashes);
|
||||||
|
while (list($key) = each($this->maybe_slashes))
|
||||||
|
{
|
||||||
|
$this->data[$key] = stripslashes($this->data[$key]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $this->data;
|
return $this->data;
|
||||||
}
|
}
|
||||||
@ -220,17 +227,18 @@
|
|||||||
{
|
{
|
||||||
while (list($key,$val) = each($values))
|
while (list($key,$val) = each($values))
|
||||||
{
|
{
|
||||||
$this->data['info_'.$key] = $val; // update internal data
|
if ($key != 'info_id')
|
||||||
|
{
|
||||||
switch ($key)
|
$key = 'info_'.$key;
|
||||||
|
|
||||||
|
$this->data[$key] = $val; // update internal data
|
||||||
|
|
||||||
|
if ($this->maybe_slashes[$key])
|
||||||
{
|
{
|
||||||
case 'info_id':
|
|
||||||
break;
|
|
||||||
case 'des': case 'subject': case 'from': case 'addr':
|
|
||||||
$val = addslashes($val);
|
$val = addslashes($val);
|
||||||
default:
|
}
|
||||||
if ($query) $query .= ',';
|
if ($query) $query .= ',';
|
||||||
$query .= "info_$key='$val'";
|
$query .= "$key='$val'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($values['info_id'])
|
if ($values['info_id'])
|
||||||
|
Loading…
Reference in New Issue
Block a user