Code Duplication    Length = 5-5 lines in 2 locations

modules/amp/includes/sanitizers/class-amp-audio-sanitizer.php 1 location

@@ 51-55 (lines=5) @@
48
			//
49
			// TODO: Add a fallback handler.
50
			// See: https://github.com/ampproject/amphtml/issues/2261
51
			if ( 0 === $new_node->childNodes->length && empty( $new_attributes['src'] ) ) {
52
				$node->parentNode->removeChild( $node );
53
			} else {
54
				$node->parentNode->replaceChild( $new_node, $node );
55
			}
56
57
			$this->did_convert_elements = true;
58
		}

modules/amp/includes/sanitizers/class-amp-video-sanitizer.php 1 location

@@ 48-52 (lines=5) @@
45
			//
46
			// TODO: Add a fallback handler.
47
			// See: https://github.com/ampproject/amphtml/issues/2261
48
			if ( 0 === $new_node->childNodes->length && empty( $new_attributes['src'] ) ) {
49
				$node->parentNode->removeChild( $node );
50
			} else {
51
				$node->parentNode->replaceChild( $new_node, $node );
52
			}
53
		}
54
	}
55