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) || (('tar' !== $p_mode) && ('tgz' !== $p_mode))) {
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)) {
@@ 1101-1113 (lines=13) @@
1098
        $v_list_detail = [];
1099
1100
        // ----- Check the parameters
1101
        if (('' == $p_tarname) || (('tar' !== $p_mode) && ('tgz' !== $p_mode))) {
1102
            // ----- Error log
1103
            if ('' == $p_tarname) {
1104
                PclErrorLog(-3, 'Invalid empty archive name');
1105
            } else {
1106
                PclErrorLog(-3, "Unknown mode '$p_mode'");
1107
            }
1108
1109
            // ----- Return
1110
            TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
1111
1112
            return PclErrorCode();
1113
        }
1114
1115
        // ----- Look for tar file
1116
        if ('tar' === $p_mode) {