Code Duplication    Length = 6-7 lines in 2 locations

admin/admin.blog.php 2 locations

@@ 113-118 (lines=6) @@
110
            $blogs[] = $blog_obj->getVar('blog_id');
111
            unset($blog_obj);
112
        }
113
        if (!empty(Request::getArray('categories', [], 'POST'))) {
114
            $categoryHandler = xoops_getModuleHandler('category', $GLOBALS['moddirname']);
115
            foreach (Request::getArray('categories', [], 'POST') as $cat_id) {
116
                $categoryHandler->addBlogs($cat_id, $blogs);
117
            }
118
        }
119
        $message = planet_constant('AM_DBUPDATED');
120
        redirect_header('admin.blog.php', 2, $message);
121
@@ 137-143 (lines=7) @@
134
    /* add a list of blogs to a category */
135
    // no break
136
    case 'register':
137
        if (!empty(Request::getArray('category_dest', [], 'POST'))) {
138
            if (!is_array($blog_id)) {
139
                $blog_id = [$blog_id];
140
            }
141
            $categoryHandler = xoops_getModuleHandler('category', $GLOBALS['moddirname']);
142
            $categoryHandler->addBlogs(Request::getArray('category_dest', [], 'POST'), $blog_id);
143
        }
144
        $message = planet_constant('AM_DBUPDATED');
145
        redirect_header('admin.blog.php?category=' . Request::getArray('category_dest', [], 'POST') . '&start=' . $start, 2, $message);
146