Code Duplication    Length = 10-10 lines in 2 locations

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

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