From 968f1ccf919a81b8190c137b6eda4ff9d79d7e97 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 24 Jul 2004 20:29:15 +0000 Subject: [PATCH] fixed bug [ 991222 ] Error uploading file - thought the whole class need to be reworked with the new db-functions --- phpgwapi/inc/class.vfs_sql.inc.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.vfs_sql.inc.php b/phpgwapi/inc/class.vfs_sql.inc.php index 9943cee3cb..ced2e6f50f 100644 --- a/phpgwapi/inc/class.vfs_sql.inc.php +++ b/phpgwapi/inc/class.vfs_sql.inc.php @@ -2022,7 +2022,15 @@ $sql .= ', '; } - $sql .= "$attribute='" . $this->clean_string (array ('string' => $data['attributes'][$attribute])) . "'"; + // RalfBecker 2004/07/24: + // this is only a hack to fix bug [ 991222 ] Error uploading file + // the whole class need to be reworked with the new db-functions + if (!isset($this->column_defs)) + { + $table_defs = $GLOBALS['phpgw']->db->get_table_definitions('phpgwapi','phpgw_vfs'); + $this->column_defs = $table_defs['fd']; + } + $sql .= $attribute.'=' .$GLOBALS['phpgw']->db->quote($data['attributes'][$attribute],$this->column_defs[$attribute]['type']); $change_attributes++; } @@ -2032,7 +2040,7 @@ { return True; // nothing to do } - $sql .= " WHERE file_id='$record[file_id]'"; + $sql .= ' WHERE file_id='.(int) $record['file_id']; $sql .= $this->extra_sql (array ('query_type' => VFS_SQL_UPDATE)); $query = $GLOBALS['phpgw']->db->query ($sql, __LINE__, __FILE__);