Index: wp-includes/default-filters.php
===================================================================
--- wp-includes/default-filters.php	(revision 5815)
+++ wp-includes/default-filters.php	(working copy)
@@ -190,4 +190,7 @@
 add_action('save_post', '_save_post_hook', 5, 2);
 add_action('transition_post_status', '_transition_post_status', 5, 3);
 
+// actions to schedule the update_links call
+add_action('update_links','wp_update_links');
+add_action('update_option_use_linksupdate', 'links_update_change',10,2);
 ?>
\ No newline at end of file
Index: wp-includes/pluggable.php
===================================================================
--- wp-includes/pluggable.php	(revision 5815)
+++ wp-includes/pluggable.php	(working copy)
@@ -174,7 +174,7 @@
 	if ( empty( $headers ) ) {
 		$headers = array();
 	} elseif ( !is_array( $headers ) ) {
-		// Explode the headers out, so this function can take both 
+		// Explode the headers out, so this function can take both
 		// string headers and an array of headers.
 		$tempheaders = (array) explode( "\n", $headers );
 		$headers = array();
@@ -396,7 +396,7 @@
 	$location = apply_filters('wp_redirect', $location, $status);
 
 	if ( !$location ) // allows the wp_redirect filter to cancel a redirect
-		return false; 
+		return false;
 
 	$location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location);
 	$location = wp_kses_no_null($location);
@@ -548,7 +548,7 @@
 	global $wpdb;
 
 	if( get_option( "moderation_notify" ) == 0 )
-		return true; 
+		return true;
 
 	$comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
 	$post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");
@@ -653,4 +653,65 @@
 }
 endif;
 
-?>
+if ( !function_exists('wp_update_links') ) :
+// the links update function
+function wp_update_links() {
+
+	if ( !get_option('use_linksupdate') )
+		return;
+
+	$link_uris = $wpdb->get_col("SELECT link_url FROM $wpdb->links");
+
+	if ( !$link_uris )
+		return;
+
+	$link_uris = urlencode( join( $link_uris, "\n" ) );
+
+	$query_string = "uris=$link_uris";
+
+	$http_request  = "POST /updated-batch/ HTTP/1.0\r\n";
+	$http_request .= "Host: api.pingomatic.com\r\n";
+	$http_request .= 'Content-Type: application/x-www-form-urlencoded; charset='.get_option('blog_charset')."\r\n";
+	$http_request .= 'Content-Length: ' . strlen($query_string) . "\r\n";
+	$http_request .= 'User-Agent: WordPress/' . $wp_version . "\r\n";
+	$http_request .= "\r\n";
+	$http_request .= $query_string;
+
+	$response = '';
+	if ( false !== ( $fs = @fsockopen('api.pingomatic.com', 80, $errno, $errstr, 5) ) ) {
+		fwrite($fs, $http_request);
+		while ( !feof($fs) )
+			$response .= fgets($fs, 1160); // One TCP-IP packet
+		fclose($fs);
+
+		$response = explode("\r\n\r\n", $response, 2);
+		$body = trim( $response[1] );
+		$body = str_replace(array("\r\n", "\r"), "\n", $body);
+
+		$returns = explode("\n", $body);
+
+		foreach ($returns as $return) :
+			$time = $wpdb->escape( substr($return, 0, 19) );
+			$uri = $wpdb->escape( preg_replace('/(.*?) | (.*?)/', '$2', $return) );
+			$wpdb->query("UPDATE $wpdb->links SET link_updated = '$time' WHERE link_url = '$uri'");
+		endforeach;
+	}
+}
+endif;
+
+if ( !function_exists('wp_links_update_change') ) :
+// the update_links scheduler function
+function wp_links_update_change($oldvalue, $newvalue) {
+
+	if ($oldvalue == $newvalue) return;
+
+	if ($newvalue == 1) {
+		wp_schedule_event(time(), apply_filters('update_links_schedule','daily'), 'update_links');
+	}
+	else {
+		wp_clear_scheduled_hook('update_links');
+	}
+}
+endif;
+
+?>
\ No newline at end of file
