Introduce sanitize_trackback_urls(). Don't ping bad urls. Don't ping bad urls or save them to the DB. Props xknown, SergeyBiryukov. fixes #17560

git-svn-id: https://develop.svn.wordpress.org/trunk@19675 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2012-01-04 19:45:13 +00:00
parent f6b0e7e580
commit 0f2274ee75
2 changed files with 21 additions and 2 deletions
+2 -2
View File
@@ -2537,7 +2537,7 @@ function wp_insert_post($postarr, $wp_error = false) {
$ping_status = get_option('default_ping_status');
if ( isset($to_ping) )
$to_ping = preg_replace('|\s+|', "\n", $to_ping);
$to_ping = sanitize_trackback_urls( $to_ping );
else
$to_ping = '';
@@ -3064,7 +3064,7 @@ function get_pung($post_id) {
function get_to_ping($post_id) {
global $wpdb;
$to_ping = $wpdb->get_var( $wpdb->prepare( "SELECT to_ping FROM $wpdb->posts WHERE ID = %d", $post_id ));
$to_ping = trim($to_ping);
$to_ping = sanitize_trackback_urls( $to_ping );
$to_ping = preg_split('/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY);
$to_ping = apply_filters('get_to_ping', $to_ping);
return $to_ping;