summaryrefslogtreecommitdiff
path: root/public/upload.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-06-18 15:46:57 +0500
committerilotterytea <iltsu@alright.party>2025-06-18 15:46:57 +0500
commit3e50715ff37af8076dcad98cf321d3b66f0a034c (patch)
tree48bccffb2bfbf0b07aac839438cb74ab711a0044 /public/upload.php
parent5ccc4a0fce0548697e5e57253f977d2d14a6cbea (diff)
fix: don't add a view from the owner
Diffstat (limited to 'public/upload.php')
-rw-r--r--public/upload.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/public/upload.php b/public/upload.php
index fac7c5c..08de5a1 100644
--- a/public/upload.php
+++ b/public/upload.php
@@ -317,6 +317,11 @@ try {
$db->prepare('INSERT INTO file_metadata(width, height, duration, line_count, id) VALUES (?, ?, ?, ?, ?)')
->execute(array_values($file_data['metadata']));
}
+
+ // don't add a view from the owner
+ $viewed_file_ids = $_SESSION['viewed_file_ids'] ?? [];
+ array_push($viewed_file_ids, $file_id);
+ $_SESSION['viewed_file_ids'] = $viewed_file_ids;
} catch (RuntimeException $e) {
generate_alert(
"/",