Code Duplication    Length = 8-8 lines in 2 locations

src/base/extension/AssetsParser.php 2 locations

@@ 389-396 (lines=8) @@
386
            if ($debug) {
387
                $file = str_replace(".js", "_" . $original_filename, $file);
388
            }
389
        } elseif (preg_match("/image/i", $mime)) {
390
            $ext = explode(".", $string);
391
            $file = "/" . substr(md5($string), 0, 8) . "." . $ext[count($ext) - 1];
392
            $html_base = "img";
393
            if ($debug) {
394
                $file = str_replace("." . $ext[count($ext) - 1], "_" . $original_filename, $file);
395
            }
396
        } elseif (preg_match("/(doc|pdf)/i", $mime)) {
397
            $ext = explode(".", $string);
398
            $file = "/" . substr(md5($string), 0, 8) . "." . $ext[count($ext) - 1];
399
            $html_base = "docs";
@@ 403-410 (lines=8) @@
400
            if ($debug) {
401
                $file = str_replace("." . $ext[count($ext) - 1], "_" . $original_filename, $file);
402
            }
403
        } elseif (preg_match("/(video|audio|ogg)/i", $mime)) {
404
            $ext = explode(".", $string);
405
            $file = "/" . substr(md5($string), 0, 8) . "." . $ext[count($ext) - 1];
406
            $html_base = "media";
407
            if ($debug) {
408
                $file = str_replace("." . $ext[count($ext) - 1], "_" . $original_filename, $file);
409
            }
410
        } elseif (preg_match("/(text|html)/i", $mime)) {
411
            $ext = explode(".", $string);
412
            $file = "/" . substr(md5($string), 0, 8) . "." . $ext[count($ext) - 1];
413
            $html_base = "templates";