From 80a142c6a4a90ad367bcdc7be5d33bbb0fabd59b Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 17 Oct 2012 17:44:40 +0000 Subject: [PATCH] Pass each url in ping_sites through esc_url_raw() upin save. This ensures the urls have a valid protocol and avoids "Unable to parse URL" warning in WP_Http. Props SergeyBiryukov. fixes #21966 git-svn-id: http://core.svn.wordpress.org/trunk@22255 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index e348250abd..c9f44947c0 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -2824,10 +2824,16 @@ function sanitize_option($option, $value) { case 'mailserver_url': case 'mailserver_login': case 'mailserver_pass': - case 'ping_sites': case 'upload_path': - $value = strip_tags($value); - $value = wp_kses_data($value); + $value = strip_tags( $value ); + $value = wp_kses_data( $value ); + break; + + case 'ping_sites': + $value = explode( "\n", $value ); + $value = array_filter( array_map( 'trim', $value ) ); + $value = array_filter( array_map( 'esc_url_raw', $value ) ); + $value = implode( "\n", $value ); break; case 'gmt_offset':