Code Duplication    Length = 7-9 lines in 2 locations

edit_interface.php 2 locations

@@ 2968-2974 (lines=7) @@
2965
	foreach (array_keys($adv_name_fields) as $tag) {
2966
		// Edit existing tags, grouped together
2967
		if (preg_match_all('/2 ' . $tag . ' (.+)/', $namerec, $match)) {
2968
			foreach ($match[1] as $value) {
2969
				echo FunctionsEdit::addSimpleTag('2 ' . $tag . ' ' . $value, '', GedcomTag::getLabel('NAME:' . $tag, $person));
2970
				if ($tag === '_MARNM') {
2971
					preg_match_all('/\/([^\/]*)\//', $value, $matches);
2972
					echo FunctionsEdit::addSimpleTag('2 _MARNM_SURN ' . implode(',', $matches[1]));
2973
				}
2974
			}
2975
		}
2976
		// Allow a new tag to be entered
2977
		if (!array_key_exists($tag, $name_fields)) {
@@ 2986-2994 (lines=9) @@
2983
	}
2984
2985
	// Third - new/existing custom name fields
2986
	foreach ($name_fields as $tag => $value) {
2987
		if (substr_compare($tag, '_', 0, 1) === 0) {
2988
			echo FunctionsEdit::addSimpleTag('0 ' . $tag . ' ' . $value);
2989
			if ($tag === '_MARNM') {
2990
				preg_match_all('/\/([^\/]*)\//', $value, $matches);
2991
				echo FunctionsEdit::addSimpleTag('2 _MARNM_SURN ' . implode(',', $matches[1]));
2992
			}
2993
		}
2994
	}
2995
2996
	// Fourth - SOUR, NOTE, _CUSTOM, etc.
2997
	if ($namerec) {