Code Duplication    Length = 5-5 lines in 3 locations

application/modules/menu/admin.php 3 locations

@@ 221-225 (lines=5) @@
218
219
                //preparing roles
220
                $roles = $this->input->post('item_roles');
221
                if ($roles == NULL) {
222
                    $roles = '';
223
                } else {
224
                    $roles = serialize($this->input->post('item_roles'));
225
                }
226
227
                //preparing main data
228
                $item_data = [
@@ 612-616 (lines=5) @@
609
                }
610
611
                $roles = $this->input->post('item_roles');
612
                if ($roles == NULL) {
613
                    $roles = '';
614
                } else {
615
                    $roles = serialize($this->input->post('item_roles'));
616
                }
617
618
                $item_data = [
619
                              'menu_id'    => $this->input->post('menu_id'),
@@ 751-755 (lines=5) @@
748
    public function insert_menu_item() {
749
750
        $roles = $this->input->post('roles');
751
        if ($roles == NULL) {
752
            $roles = '';
753
        } else {
754
            $roles = serialize($this->input->post('roles'));
755
        }
756
757
        // Item position
758
        if ($this->input->post('position_after') > 0) {