Code Duplication    Length = 6-20 lines in 2 locations

wp-admin/includes/upgrade.php 1 location

@@ 2096-2115 (lines=20) @@
2093
 * @param string $content The content to modify.
2094
 * @return string The de-slashed content.
2095
 */
2096
function deslash($content) {
2097
	// Note: \\\ inside a regex denotes a single backslash.
2098
2099
	/*
2100
	 * Replace one or more backslashes followed by a single quote with
2101
	 * a single quote.
2102
	 */
2103
	$content = preg_replace("/\\\+'/", "'", $content);
2104
2105
	/*
2106
	 * Replace one or more backslashes followed by a double quote with
2107
	 * a double quote.
2108
	 */
2109
	$content = preg_replace('/\\\+"/', '"', $content);
2110
2111
	// Replace one or more backslashes with one backslash.
2112
	$content = preg_replace("/\\\+/", "\\", $content);
2113
2114
	return $content;
2115
}
2116
2117
/**
2118
 * Modifies the database based on specified SQL statements.

wp-includes/functions.php 1 location

@@ 510-515 (lines=6) @@
507
 * @param string $content XML-RPC XML Request content.
508
 * @return string XMLRPC XML Request content without title and category elements.
509
 */
510
function xmlrpc_removepostdata( $content ) {
511
	$content = preg_replace( '/<title>(.+?)<\/title>/si', '', $content );
512
	$content = preg_replace( '/<category>(.+?)<\/category>/si', '', $content );
513
	$content = trim( $content );
514
	return $content;
515
}
516
517
/**
518
 * Use RegEx to extract URLs from arbitrary content.