Code Duplication    Length = 6-6 lines in 2 locations

action.blog.php 1 location

@@ 107-112 (lines=6) @@
104
            $blog_obj->setVar('blog_submitter', is_object($xoopsUser) ? $xoopsUser->getVar('uid') : planet_getIP(true));
105
        }
106
107
        if (!$blog_handler->insert($blog_obj)) {
108
        } elseif (!empty($_POST['categories'])) {
109
            $blog_id = $blog_obj->getVar('blog_id');
110
            if (in_array(0, $_POST['categories'])) {
111
                $_POST['categories'] = array();
112
            }
113
            $blog_handler->setCategories($blog_id, $_POST['categories']);
114
        }
115
        $message = planet_constant('MD_DBUPDATED');

admin/admin.blog.php 1 location

@@ 80-85 (lines=6) @@
77
        $blog_obj->setVar('blog_trackback', $_POST['blog_trackback']);
78
        $blog_obj->setVar('blog_status', $_POST['blog_status']);
79
80
        if (!$blog_handler->insert($blog_obj)) {
81
        } elseif (!empty($_POST['categories'])) {
82
            $blog_id = $blog_obj->getVar('blog_id');
83
            if (in_array(0, $_POST['categories'])) {
84
                $_POST['categories'] = array();
85
            }
86
            $blog_handler->setCategories($blog_id, $_POST['categories']);
87
        }
88
        $message = planet_constant('AM_DBUPDATED');