Code Duplication    Length = 7-7 lines in 2 locations

class/ObjectController.php 2 locations

@@ 55-61 (lines=7) @@
52
        foreach (array_keys($smartObj->vars) as $key) {
53
            switch ($smartObj->vars[$key]['data_type']) {
54
                case XOBJ_DTYPE_IMAGE:
55
                    if (isset($_POST['url_' . $key]) && '' !== $_POST['url_' . $key]) {
56
                        $oldFile = $smartObj->getUploadDir(true) . $smartObj->getVar($key, 'e');
57
                        $smartObj->setVar($key, $_POST['url_' . $key]);
58
                        if (file_exists($oldFile)) {
59
                            unlink($oldFile);
60
                        }
61
                    }
62
                    if (isset($_POST['delete_' . $key]) && '1' == $_POST['delete_' . $key]) {
63
                        $oldFile = $smartObj->getUploadDir(true) . $smartObj->getVar($key, 'e');
64
                        $smartObj->setVar($key, '');
@@ 62-68 (lines=7) @@
59
                            unlink($oldFile);
60
                        }
61
                    }
62
                    if (isset($_POST['delete_' . $key]) && '1' == $_POST['delete_' . $key]) {
63
                        $oldFile = $smartObj->getUploadDir(true) . $smartObj->getVar($key, 'e');
64
                        $smartObj->setVar($key, '');
65
                        if (file_exists($oldFile)) {
66
                            unlink($oldFile);
67
                        }
68
                    }
69
                    break;
70
71
                case XOBJ_DTYPE_URLLINK: