Code Duplication    Length = 9-9 lines in 3 locations

controller/acp/cat.php 1 location

@@ 892-900 (lines=9) @@
889
        while ($row = $this->db->sql_fetchrow($result)) {
890
            $link_ids[] = $row['link_id'];
891
892
            if ($row['link_banner'] && !preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner'])) {
893
                $banner_img = $this->dir_helper->get_banner_path(basename($row['link_banner']));
894
895
                if (file_exists($banner_img)) {
896
                    @unlink($banner_img);
897
                }
898
            }
899
        }
900
        $this->db->sql_freeresult($result);
901
902
        if (count($link_ids)) {
903
            // Delete links datas

controller/acp/validation.php 1 location

@@ 341-349 (lines=9) @@
338
    private function _action_disapproved()
339
    {
340
        foreach ($this->links_data as $row) {
341
            if ($row['link_banner'] && !preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner'])) {
342
                $banner_img = $this->dir_helper->get_banner_path(basename($row['link_banner']));
343
344
                if (file_exists($banner_img)) {
345
                    @unlink($banner_img);
346
                }
347
            }
348
349
            $sql = 'DELETE FROM '.DIR_LINK_TABLE.' WHERE link_id = '.(int) $row['link_id'];
350
            $this->db->sql_query($sql);
351
        }
352
    }

core/link.php 1 location

@@ 204-212 (lines=9) @@
201
        $result = $this->db->sql_query($sql);
202
203
        while ($row = $this->db->sql_fetchrow($result)) {
204
            if ($row['link_banner'] && !preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner'])) {
205
                $banner_img = $this->dir_helper->get_banner_path(basename($row['link_banner']));
206
207
                if (file_exists($banner_img)) {
208
                    @unlink($banner_img);
209
                }
210
            }
211
        }
212
213
        foreach ($link_datas_ary as $table => $field) {
214
            $this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $url_array));
215
        }