Code Duplication    Length = 18-18 lines in 2 locations

controller/rest/publiccontroller.php 2 locations

@@ 60-77 (lines=18) @@
57
     * @NoAdminRequired
58
     * @NoCSRFRequired
59
     */
60
    public function returnAddAsJson($user, $url = "", $tags = array(), $title = "", $description = "") {
61
62
        if ($tags[0] == "") {
63
            $tags = array();
64
        }
65
66
        $output = Bookmarks::addBookmark($user, $this->db, $url, $title, $tags, $description, false);
67
68
        if (count($output) == 0) {
69
            $output["status"] = 'error';
70
            $output["message"] = "No results from this query";
71
            return new JSONResponse($output);
72
        }
73
74
        $output = Bookmarks::findUniqueBookmark($output,$user,$this->db);
75
76
        return new JSONResponse($output);
77
    }
78
79
    /**
80
     * @CORS
@@ 84-101 (lines=18) @@
81
     * @NoAdminRequired
82
     * @NoCSRFRequired
83
     */
84
    public function returnUpdateAsJson($user, $id, $url = "", $tags = array(), $title = "", $description = "") {
85
86
        if ($tags[0] == "") {
87
            $tags = array();
88
        }
89
90
        $output = Bookmarks::editBookmark($user, $this->db, $id, $url, $title, $tags, $description, false);
91
92
        if (count($output) == 0) {
93
            $output["status"] = 'error';
94
            $output["message"] = "No results from this query";
95
            return new JSONResponse($output);
96
        }
97
98
        $output = Bookmarks::findUniqueBookmark($output,$user,$this->db);
99
100
        return new JSONResponse($output);
101
    }
102
103
    /**
104
     * @CORS