Code Duplication    Length = 11-11 lines in 2 locations

api/functions.php 1 location

@@ 720-730 (lines=11) @@
717
718
                            // Add tags
719
                            $tags = explode(' ', $item_tags);
720
                            foreach ((array) $tags as $tag) {
721
                                if (!empty($tag)) {
722
                                    DB::insert(
723
                                        prefix_table("tags"),
724
                                        array(
725
                                            "item_id" => $newID,
726
                                            "tag" => strtolower($tag)
727
                                        )
728
                                    );
729
                                }
730
                            }
731
732
                            // Update CACHE table
733
                            DB::insert(

sources/items.queries.php 1 location

@@ 281-291 (lines=11) @@
278
                logItems($newID, $label, $_SESSION['user_id'], 'at_creation', $_SESSION['login']);
279
                // Add tags
280
                $tags = explode(' ', $tags);
281
                foreach ($tags as $tag) {
282
                    if (!empty($tag)) {
283
                        DB::insert(
284
                            prefix_table('tags'),
285
                            array(
286
                                'item_id' => $newID,
287
                                'tag' => strtolower($tag)
288
                                )
289
                        );
290
                    }
291
                }
292
                // Check if any files have been added
293
                if (!empty($dataReceived['random_id_from_files'])) {
294
                    $rows = DB::query("SELECT id