Appears to fix problems with bad data sent to a couple of functions, causing bad SQL generation

This commit is contained in:
Miles Lott 2004-01-02 22:49:10 +00:00
parent 6a5b4e957e
commit 5dbef396f9

View File

@ -207,7 +207,7 @@
$table_column = ' * ';
}
$sql = "SELECT $table_column from phpgw_categories WHERE (cat_appname='" . $this->app_name . "' AND" . $grant_cats . $global_cats . ')'
$sql = "SELECT $table_column FROM phpgw_categories WHERE (cat_appname='" . $this->app_name . "' AND" . $grant_cats . $global_cats . ')'
. $parent_filter . $querymethod . $filter;
$this->db2->query($sql,__LINE__,__FILE__);
@ -309,7 +309,7 @@
$querymethod = " AND (cat_name LIKE '%$query%' OR cat_description LIKE '%$query%') ";
}
$sql = "SELECT * from phpgw_categories WHERE (cat_appname='" . $this->app_name . "' AND" . $grant_cats . $global_cats . ")"
$sql = "SELECT * FROM phpgw_categories WHERE (cat_appname='" . $this->app_name . "' AND" . $grant_cats . $global_cats . ")"
. $querymethod;
$this->db2->query($sql . $parent_select,__LINE__,__FILE__);
@ -721,12 +721,12 @@
}
switch($item)
{
default: //fall through
case 'name': $value = 'cat_name'; break;
case 'owner': $value = 'cat_owner'; break;
case 'main': $value = 'cat_main'; break;
case 'level': $value = 'cat_level'; break;
case 'parent': $value = 'cat_parent'; break;
case 'name':
default: $value = 'cat_parent'; break;
}
$this->db->query("SELECT $value FROM phpgw_categories WHERE cat_id=" . $cat_id,__LINE__,__FILE__);