Code Duplication    Length = 8-8 lines in 2 locations

manager/includes/functions/tv.php 2 locations

@@ 954-961 (lines=8) @@
951
                        }
952
                    } elseif (substr($field_elements, 0, 8) == '@INCLUDE') {
953
                        $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9));
954
                        if (!file_exists($file_name)) {
955
                            $custom_output = $file_name . ' does not exist';
956
                        } else {
957
                            ob_start();
958
                            include $file_name;
959
                            $custom_output = ob_get_contents();
960
                            ob_end_clean();
961
                        }
962
                    } elseif (substr($field_elements, 0, 6) == "@CHUNK") {
963
                        $chunk_name = trim(substr($field_elements, 7));
964
                        $chunk_body = $modx->getChunk($chunk_name);
@@ 998-1005 (lines=8) @@
995
            $custom = explode(":", $field_type);
996
            $custom_output = '';
997
            $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php';
998
            if (!file_exists($file_name)) {
999
                $custom_output = $file_name . ' does not exist';
1000
            } else {
1001
                ob_start();
1002
                include $file_name;
1003
                $custom_output = ob_get_contents();
1004
                ob_end_clean();
1005
            }
1006
            $replacements = array(
1007
                '[+field_type+]'   => $field_type,
1008
                '[+field_id+]'     => $field_id,