aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/annotations.php8
-rw-r--r--engine/lib/metadata.php9
2 files changed, 13 insertions, 4 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index 097bb24de..0e8df9c8a 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -212,13 +212,13 @@
$value_type = detect_annotation_valuetype($value, sanitise_string(trim($value_type)));
$owner_id = (int)$owner_id;
- if ($owner_id=0) $owner_id = $_SESSION['id'];
+ if ($owner_id==0) $owner_id = $_SESSION['id'];
$access_id = (int)$access_id;
+ $time = time();
-
- return insert_data("INSERT into {$CONFIG->dbprefix}annotations (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)");
+ return insert_data("INSERT into {$CONFIG->dbprefix}annotations (object_id, object_type, name, value, value_type, owner_id, created, access_id) VALUES ($object_id,'$object_type','$name','$value','$value_type', $owner_id, $time, $access_id)");
}
/**
@@ -241,7 +241,7 @@
$value_type = detect_annotation_valuetype($value, sanitise_string(trim($value_type)));
$owner_id = (int)$owner_id;
- if ($owner_id=0) $owner_id = $_SESSION['id'];
+ if ($owner_id==0) $owner_id = $_SESSION['id'];
$access_id = (int)$access_id;
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;