Code Duplication    Length = 12-13 lines in 2 locations

class/pcltar.lib.php 2 locations

@@ 108-119 (lines=12) @@
105
        $v_result = 1;
106
107
        // ----- Look for default mode
108
        if (($p_mode == '') || (($p_mode !== 'tar') && ($p_mode !== 'tgz'))) {
109
            // ----- Extract the tar format from the extension
110
            if (($p_mode = PclTarHandleExtension($p_tarname)) == '') {
111
                // ----- Return
112
                TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
113
114
                return PclErrorCode();
115
            }
116
117
            // ----- Trace
118
            TrFctMessage(__FILE__, __LINE__, 1, "Auto mode selected : found $p_mode");
119
        }
120
121
        // ----- Look if the $p_filelist is really an array
122
        if (is_array($p_filelist)) {
@@ 1102-1114 (lines=13) @@
1099
        $v_list_detail = array();
1100
1101
        // ----- Check the parameters
1102
        if (($p_tarname == '') || (($p_mode !== 'tar') && ($p_mode !== 'tgz'))) {
1103
            // ----- Error log
1104
            if ($p_tarname == '') {
1105
                PclErrorLog(-3, 'Invalid empty archive name');
1106
            } else {
1107
                PclErrorLog(-3, "Unknown mode '$p_mode'");
1108
            }
1109
1110
            // ----- Return
1111
            TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
1112
1113
            return PclErrorCode();
1114
        }
1115
1116
        // ----- Look for tar file
1117
        if ($p_mode === 'tar') {