Code Duplication    Length = 8-11 lines in 2 locations

src/wp-includes/class-wp-simplepie-sanitize-kses.php 1 location

@@ 38-45 (lines=8) @@
35
	 */
36
	public function sanitize( $data, $type, $base = '' ) {
37
		$data = trim( $data );
38
		if ( $type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML ) {
39
			if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data)) {
40
				$type |= SIMPLEPIE_CONSTRUCT_HTML;
41
			}
42
			else {
43
				$type |= SIMPLEPIE_CONSTRUCT_TEXT;
44
			}
45
		}
46
		if ( $type & SIMPLEPIE_CONSTRUCT_BASE64 ) {
47
			$data = base64_decode( $data );
48
		}

src/wp-includes/SimplePie/Sanitize.php 1 location

@@ 230-240 (lines=11) @@
227
		$data = trim($data);
228
		if ($data !== '' || $type & SIMPLEPIE_CONSTRUCT_IRI)
229
		{
230
			if ($type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML)
231
			{
232
				if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data))
233
				{
234
					$type |= SIMPLEPIE_CONSTRUCT_HTML;
235
				}
236
				else
237
				{
238
					$type |= SIMPLEPIE_CONSTRUCT_TEXT;
239
				}
240
			}
241
242
			if ($type & SIMPLEPIE_CONSTRUCT_BASE64)
243
			{