From b8530b23aebd8734fa9ba7da7ca5c470ddf08945 Mon Sep 17 00:00:00 2001 From: e107steved Date: Tue, 6 Dec 2011 08:31:41 +0000 Subject: [PATCH] Reinstate selective block of preset fields --- e107_handlers/preset_class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/e107_handlers/preset_class.php b/e107_handlers/preset_class.php index 45693a461..579611fcb 100644 --- a/e107_handlers/preset_class.php +++ b/e107_handlers/preset_class.php @@ -45,10 +45,11 @@ class e_preset global $sql, $ns, $tp; $qry = explode(".", e_QUERY); $unique_id = is_array($this->id) ? $this->id : array($this->id); - $uid = $qry[1]; + $uid = $tp->toDB(varset($qry[1], 0)); if($_POST && $qry[0] == "savepreset") { + $saveID = $tp -> toDB($unique_id[$uid], true); $exclude_array = explode(',',$exclude_fields); $existing = $sql->db_Count("preset", "(*)", " WHERE preset_name='".$saveID."' ") ? TRUE : FALSE; foreach($_POST as $key => $value) @@ -57,7 +58,10 @@ class e_preset { unset($_POST[$key]); // Remove any fields excluded from preset, and those with potentially dubious key names } - $_POST[$key] = $tp->toDB($value); + else + { + $_POST[$key] = $tp->toDB($value); + } } if ($existing) @@ -81,7 +85,7 @@ class e_preset if($_POST['delete_preset'] && e_QUERY == "clr_preset") { - $del = $_POST['del_id']; + $del = $tp->toDB($_POST['del_id']); $check = $sql->db_Delete("preset", "preset_name ='".$unique_id[$del]."' "); if($output)