Code Duplication    Length = 10-10 lines in 2 locations

main/inc/lib/document.lib.php 2 locations

@@ 373-382 (lines=10) @@
370
            //header('Cache-Control: no-cache, must-revalidate');
371
            //header('Pragma: no-cache');
372
            switch ($content_type) {
373
                case 'text/html':
374
                    if (isset($lpFixedEncoding) && $lpFixedEncoding === 'true') {
375
                        $content_type .= '; charset=UTF-8';
376
                    } else {
377
                        $encoding = @api_detect_encoding_html(file_get_contents($full_file_name));
378
                        if (!empty($encoding)) {
379
                            $content_type .= '; charset=' . $encoding;
380
                        }
381
                    }
382
                    break;
383
                case 'text/plain':
384
                    if (isset($lpFixedEncoding) && $lpFixedEncoding === 'true') {
385
                        $content_type .= '; charset=UTF-8';
@@ 383-392 (lines=10) @@
380
                        }
381
                    }
382
                    break;
383
                case 'text/plain':
384
                    if (isset($lpFixedEncoding) && $lpFixedEncoding === 'true') {
385
                        $content_type .= '; charset=UTF-8';
386
                    } else {
387
                        $encoding = @api_detect_encoding(strip_tags(file_get_contents($full_file_name)));
388
                        if (!empty($encoding)) {
389
                            $content_type .= '; charset=' . $encoding;
390
                        }
391
                    }
392
                    break;
393
                case 'application/vnd.dwg':
394
                case 'application/vnd.dwf':
395
                    header('Content-type: application/octet-stream');