Revert 23416, 23419, 23445 except for wp_reset_vars() changes. We are going a different direction with the slashing cleanup, so resetting to a clean slate. see #21767

git-svn-id: https://develop.svn.wordpress.org/trunk@23554 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2013-03-01 16:28:40 +00:00
parent 158a124d0b
commit c363aea627
89 changed files with 657 additions and 533 deletions
+3 -50
View File
@@ -1716,7 +1716,10 @@ function _split_str_by_whitespace( $string, $goal ) {
* @return string Converted content.
*/
function wp_rel_nofollow( $text ) {
// This is a pre save filter, so text is already escaped.
$text = stripslashes($text);
$text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text);
$text = esc_sql($text);
return $text;
}
@@ -3339,53 +3342,3 @@ function sanitize_trackback_urls( $to_ping ) {
$urls_to_ping = implode( "\n", $urls_to_ping );
return apply_filters( 'sanitize_trackback_urls', $urls_to_ping, $to_ping );
}
/**
* Conditionally add slashes to a string or array of strings. When GPCS
* slashing is turned on, slashes are added. When GPCS slashing is turned off,
* slashes are not added.
*
* This should be used when preparing data for core API that deal directly with GPCS data.
* Outside of unit tests, this should be rare. At a future date GPCS will no longer
* be slashed and this function will noop. Do not use it in situations where adding slashes
* is always required regardless of whether GPCS is slashed.
*
* @since 3.6.0
*
* @param string|array $value String or array of strings to slash.
* @return string|array Slashed $value
*/
function wp_slash( $value ) {
if ( is_array( $value ) ) {
foreach ( $value as $k => $v ) {
if ( is_array( $v ) ) {
$value[$k] = wp_slash( $v );
} else {
$value[$k] = addslashes( $v );
}
}
} else {
$value = addslashes( $value );
}
return $value;
}
/**
* Conditionally removes slashes from a string or array of strings. When GPCS
* slashing is turned on, slashes are stripped. When GPCS slashing is turned off,
* slashes are not stripped.
*
* This should be used for GPCS data before passing it along to core API. At a future
* date GPCS will no longer be slashed and this function will noop. Do not use it
* in situations where slash stripping is always required regardless of whether GPCS
* is slashed.
*
* @since 3.6.0
*
* @param string|array $value String or array of strings to unslash.
* @return string|array Unslashed $value
*/
function wp_unslash( $value ) {
return stripslashes_deep( $value );
}