Code Duplication    Length = 22-22 lines in 2 locations

class/pcltar.lib.php 2 locations

@@ 2117-2138 (lines=22) @@
2114
            $v_extract_file = 0;
2115
          }*/
2116
                } // ----- Check the directory availability and create it if necessary
2117
                else {
2118
                    if ('5' == $v_header['typeflag']) {
2119
                        $v_dir_to_check = $v_header['filename'];
2120
                    } else {
2121
                        if (false === strpos($v_header['filename'], '/')) {
2122
                            $v_dir_to_check = '';
2123
                        } else {
2124
                            $v_dir_to_check = dirname($v_header['filename']);
2125
                        }
2126
                    }
2127
2128
                    if (1 != ($v_result = PclTarHandlerDirCheck($v_dir_to_check))) {
2129
                        TrFctMessage(__FILE__, __LINE__, 2, 'Unable to create path for ' . $v_header['filename'] . '');
2130
2131
                        // ----- Change the file status
2132
                        $v_header['status'] = 'path_creation_fail';
2133
2134
                        // ----- Skip the extract
2135
                        $v_extraction_stopped = 1;
2136
                        $v_extract_file       = 0;
2137
                    }
2138
                }
2139
2140
                // ----- Do the extraction
2141
                if ($v_extract_file && ('5' != $v_header['typeflag'])) {
@@ 2631-2652 (lines=22) @@
2628
                }
2629
            }
2630
        } // ----- Check the directory availability and create it if necessary
2631
        else {
2632
            if ('5' == $v_header['typeflag']) {
2633
                $v_dir_to_check = $v_header['filename'];
2634
            } else {
2635
                if (false === strpos($v_header['filename'], '/')) {
2636
                    $v_dir_to_check = '';
2637
                } else {
2638
                    $v_dir_to_check = dirname($v_header['filename']);
2639
                }
2640
            }
2641
2642
            if (1 != ($v_result = PclTarHandlerDirCheck($v_dir_to_check))) {
2643
                TrFctMessage(__FILE__, __LINE__, 2, 'Unable to create path for ' . $v_header['filename'] . '');
2644
2645
                // ----- Change the file status
2646
                $v_header['status'] = 'path_creation_fail';
2647
2648
                // ----- Skip the extract
2649
                $v_extraction_stopped = 1;
2650
                $v_extract_file       = 0;
2651
            }
2652
        }
2653
2654
        // ----- Do the real bytes extraction (if not a directory)
2655
        if ($v_extract_file && ('5' != $v_header['typeflag'])) {