Code Duplication    Length = 5-5 lines in 2 locations

admin/pluginsmanager.php 2 locations

@@ 114-118 (lines=5) @@
111
112
        foreach ($types as $type) {
113
            $type4sql = addslashes($type);
114
            if (!$GLOBALS['xoopsDB']->query("INSERT INTO $cal->plugin_table SET pi_type='$type4sql', pi_options='$pi_options4sql', pi_weight='$pi_weight4sql', pi_title='$pi_title4sql', pi_dirname='$pi_dirname4sql', pi_file='$pi_file4sql', pi_dotgif='$pi_dotgif4sql', pi_enabled='1'",
115
                                            $conn)
116
            ) {
117
                die($GLOBALS['xoopsDB']->error());
118
            }
119
        }
120
    }
121
@@ 142-146 (lines=5) @@
139
            $pi_dotgif4sql  = addslashes($_POST['pi_dotgifs'][$pi_id]);
140
            $pi_enabled4sql = !empty($_POST['pi_enableds'][$pi_id]) ? 1 : 0;
141
142
            if (!$GLOBALS['xoopsDB']->query("UPDATE $cal->plugin_table SET pi_type='$pi_type4sql', pi_options='$pi_options4sql', pi_weight='$pi_weight4sql', pi_title='$pi_title4sql', pi_dirname='$pi_dirname4sql', pi_file='$pi_file4sql', pi_dotgif='$pi_dotgif4sql', pi_enabled='$pi_enabled4sql' WHERE pi_id=$pi_id",
143
                                            $conn)
144
            ) {
145
                die($GLOBALS['xoopsDB']->error());
146
            }
147
        }
148
    }
149