mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Introduce _deep_replace() and use it to improve the stripping of percent encoded values from urls. Fixes #10226 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@11615 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -880,17 +880,8 @@ function wp_sanitize_redirect($location) {
|
||||
$location = wp_kses_no_null($location);
|
||||
|
||||
// remove %0d and %0a from location
|
||||
$strip = array('%0d', '%0a');
|
||||
$found = true;
|
||||
while($found) {
|
||||
$found = false;
|
||||
foreach( (array) $strip as $val ) {
|
||||
while(strpos($location, $val) !== false) {
|
||||
$found = true;
|
||||
$location = str_replace($val, '', $location);
|
||||
}
|
||||
}
|
||||
}
|
||||
$strip = array('%0d', '%0a', '%0D', '%0A');
|
||||
$location = _deep_replace($strip, $location);
|
||||
return $location;
|
||||
}
|
||||
endif;
|
||||
|
||||
Reference in New Issue
Block a user