Fixed some variables being treated has strings becuase of things like "$somevar"

This commit is contained in:
jengo 2001-02-04 08:27:35 +00:00
parent 2e3edb1a1e
commit 5a4e1a11a1
2 changed files with 8 additions and 7 deletions

View File

@ -40,11 +40,12 @@
return $s; return $s;
} }
function return_array($type = "all") function return_array($type = "all", $id = "")
{ {
$filter = $this->filter($type); $filter = $this->filter($type);
if (gettype($type) == "integer") {
$filter = " and cat_id='$type'"; if ($type == "single") {
$filter = " and cat_id='$id'";
} }
$this->db->query("select * from phpgw_categories where cat_owner='" $this->db->query("select * from phpgw_categories where cat_owner='"
@ -115,7 +116,7 @@
. $this->account_id . "'",__LINE__,__FILE__); . $this->account_id . "'",__LINE__,__FILE__);
} }
function edit($cat_id,$cat_parent,$cat_name,$cat_description,$cat_data) function edit($cat_id,$cat_parent,$cat_name,$cat_description = "",$cat_data = "")
{ {
$this->db->query("update phpgw_categories set cat_name='" . addslashes($cat_name) . "', " $this->db->query("update phpgw_categories set cat_name='" . addslashes($cat_name) . "', "
. "cat_description='" . addslashes($cat_description) . "', cat_data='" . "cat_description='" . addslashes($cat_description) . "', cat_data='"

View File

@ -79,7 +79,7 @@
$value = $$var; $value = $$var;
} }
$this->data["$app_name"]["$var"] = $value; $this->data[$app_name][$var] = $value;
reset($this->data); reset($this->data);
return $this->data; return $this->data;
} }
@ -87,9 +87,9 @@
function delete($app_name, $var = "") function delete($app_name, $var = "")
{ {
if ($var == "") { if ($var == "") {
$this->data["$app_name"] = array(); $this->data[$app_name] = array();
} else { } else {
unset($this->data["$app_name"]["$var"]); unset($this->data[$app_name][$var]);
} }
reset ($this->data); reset ($this->data);
return $this->data; return $this->data;