Code Duplication    Length = 7-9 lines in 2 locations

class/pcltar.lib.php 2 locations

@@ 3368-3376 (lines=9) @@
3365
    */
3366
3367
        // ----- Look for no more block
3368
        if ('' === $v_binary_data) {
3369
            $v_header['filename'] = '';
3370
            $v_header['status']   = 'empty';
3371
3372
            // ----- Return
3373
            TrFctEnd(__FILE__, __LINE__, $v_result, 'End of archive found');
3374
3375
            return $v_result;
3376
        }
3377
3378
        // ----- Look for invalid block size
3379
        if (strlen($v_binary_data) != 512) {
@@ 3423-3429 (lines=7) @@
3420
            $v_header['status']   = 'invalid_header';
3421
3422
            // ----- Look for last block (empty block)
3423
            if (($v_checksum == 256) && ($v_header['checksum'] == 0)) {
3424
                $v_header['status'] = 'empty';
3425
                // ----- Return
3426
                TrFctEnd(__FILE__, __LINE__, $v_result, 'End of archive found');
3427
3428
                return $v_result;
3429
            }
3430
3431
            // ----- Error log
3432
            PclErrorLog(-13, "Invalid checksum : $v_checksum calculated, " . $v_header['checksum'] . ' expected');