Code Duplication    Length = 3-3 lines in 3 locations

admin/categories.php 2 locations

@@ 740-742 (lines=3) @@
737
            $xoopsDB->query($sql) or $eh->show('0013');
738
            rename('' . XOOPS_ROOT_PATH . "/modules/$moddir/init_uploads/" . $savedfilename . '', '' . XOOPS_ROOT_PATH . "/modules/$moddir/uploads/" . $savedfilename . '');
739
            //Delete the uploaded file from the initial upload folder if it is still present in that folder.
740
            if (file_exists('' . XOOPS_ROOT_PATH . "/modules/$moddir/init_uploads/" . $savedfilename . '')) {
741
                unlink('' . XOOPS_ROOT_PATH . "/modules/$moddir/init_uploads/" . $savedfilename . '');
742
            }
743
            redirect_header("categories.php?op=edit&catid=$p_catid", 2, _MD_CAT_UPDATED);
744
            exit();
745
        } else {
@@ 863-865 (lines=3) @@
860
            }
861
            rename('' . XOOPS_ROOT_PATH . "/modules/$moddir/init_uploads/" . $savedfilename . '', '' . XOOPS_ROOT_PATH . "/modules/$moddir/uploads/" . $savedfilename . '');
862
            //Delete the uploaded file from the initial upload folder if it is still present in that folder.
863
            if (file_exists('' . XOOPS_ROOT_PATH . "/modules/$moddir/init_uploads/" . $savedfilename . '')) {
864
                unlink('' . XOOPS_ROOT_PATH . "/modules/$moddir/init_uploads/" . $savedfilename . '');
865
            }
866
            redirect_header("categories.php?op=edit&catid=$cid", 2, _MD_CAT_SAVED);
867
            exit();
868
        } else {

admin/directories.php 1 location

@@ 184-186 (lines=3) @@
181
            //Rename the uploaded file to the same name in a different location that does not have 777 rights or 755.
182
            rename('' . XOOPS_ROOT_PATH . "/modules/$moddir/init_uploads/" . $savedfilename . '', '' . XOOPS_ROOT_PATH . "/modules/$moddir/uploads/" . $savedfilename . '');
183
            //Delete the uploaded file from the initial upload folder if it is still present in that folder.
184
            if (file_exists('' . XOOPS_ROOT_PATH . "/modules/$moddir/init_uploads/" . $savedfilename . '')) {
185
                unlink('' . XOOPS_ROOT_PATH . "/modules/$moddir/init_uploads/" . $savedfilename . '');
186
            }
187
            redirect_header("directories.php?op=moddir&dirid=$p_dirid", 2, _MD_DIR_UPDATED);
188
            exit();
189
        } else {