Code Duplication    Length = 3-3 lines in 4 locations

application/models/Media/Row.php 2 locations

@@ 101-103 (lines=3) @@
98
     */
99
    protected function afterDelete()
100
    {
101
        if (is_file(PATH_PUBLIC .'/'. $this->file)) {
102
            @unlink(PATH_PUBLIC .'/'. $this->file);
103
        }
104
        if (is_file(PATH_PUBLIC .'/'. $this->preview)) {
105
            @unlink(PATH_PUBLIC .'/'. $this->preview);
106
        }
@@ 104-106 (lines=3) @@
101
        if (is_file(PATH_PUBLIC .'/'. $this->file)) {
102
            @unlink(PATH_PUBLIC .'/'. $this->file);
103
        }
104
        if (is_file(PATH_PUBLIC .'/'. $this->preview)) {
105
            @unlink(PATH_PUBLIC .'/'. $this->preview);
106
        }
107
    }
108
}
109

application/modules/media/controllers/upload.php 2 locations

@@ 81-83 (lines=3) @@
78
            $media->save();
79
        } catch (ValidatorException $e) {
80
            // remove invalid files
81
            if (is_file(PATH_PUBLIC .'/'. $media->file)) {
82
                @unlink(PATH_PUBLIC .'/'. $media->file);
83
            }
84
            if (is_file(PATH_PUBLIC .'/'. $media->preview)) {
85
                @unlink(PATH_PUBLIC .'/'. $media->preview);
86
            }
@@ 84-86 (lines=3) @@
81
            if (is_file(PATH_PUBLIC .'/'. $media->file)) {
82
                @unlink(PATH_PUBLIC .'/'. $media->file);
83
            }
84
            if (is_file(PATH_PUBLIC .'/'. $media->preview)) {
85
                @unlink(PATH_PUBLIC .'/'. $media->preview);
86
            }
87
            // create error message
88
            $message = '';
89
            $errors = $e->getErrors();