aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/metadata.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/metadata.php')
-rw-r--r--engine/lib/metadata.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index ed2d2f0d0..b36e9ac44 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -122,7 +122,10 @@
$name = sanitise_string(trim($name));
$value = sanitise_string(trim($value));
$value_type = sanitise_string(trim($value_type));
+
$owner_id = (int)$owner_id;
+ if ($owner_id==0) $owner_id = $_SESSION['id'];
+
$access_id = (int)$access_id;
return insert_data("INSERT into {$CONFIG->dbprefix}metadata (object_id, object_type, name, value, value_type, owner_id, created, access_id) VALUES ($object_id,'$object_type','$name','$value','$value_type', $owner_id, $access_id)");
@@ -146,7 +149,10 @@
$name = sanitise_string(trim($name));
$value = sanitise_string(trim($value));
$value_type = sanitise_string(trim($value_type));
+
$owner_id = (int)$owner_id;
+ if ($owner_id==0) $owner_id = $_SESSION['id'];
+
$access_id = (int)$access_id;
$access = get_access_list();
@@ -188,7 +194,10 @@
$object_type = sanitise_string(trim($object_type));
$name = sanitise_string(trim($name));
$value = sanitise_string(trim($value));
+
$owner_id = (int)$owner_id;
+ if ($owner_id==0) $owner_id = $_SESSION['id'];
+
$limit = (int)$limit;
$offset = (int)$offset;