From 7361b3005f81f4e774ccf137ff8c0051f9080f51 Mon Sep 17 00:00:00 2001 From: "E. S." Date: Sat, 8 Feb 2025 04:02:14 +0300 Subject: [PATCH] uploads: add source_url field --- lib/uploads.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/uploads.php b/lib/uploads.php index a8649f8..ccb368d 100644 --- a/lib/uploads.php +++ b/lib/uploads.php @@ -19,7 +19,7 @@ class uploads { return in_array($ext, UPLOADS_ALLOWED_EXTENSIONS); } - static function add(string $tmp_name, string $name, string $note_en, string $note_ru): ?int { + static function add(string $tmp_name, string $name, string $note_en, string $note_ru, string $source_url = ''): ?int { global $config; $name = sanitize_filename($name); @@ -47,6 +47,7 @@ class uploads { 'note_ru' => $note_ru, 'note_en' => $note_en, 'downloads' => 0, + 'source_url' => $source_url, ])) { return null; } @@ -166,6 +167,7 @@ class Upload extends model { public int $imageH; public string $noteRu; public string $noteEn; + public string $sourceUrl; function getDirectory(): string { global $config;