From 6c4ea65b25b7436027385824f33a0d0afe84ea7b Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Fri, 5 Dec 2008 15:46:29 -0500 Subject: Fixed Pingback display problem This was only noticed when a lot of attention was put on the pingback engine when TimTam's pingback (http://tamasys.wordpress.com/2008/12/03/the-closest-book/) to (http://fourisland.com/blog/of-books-and-memes/) failed. This in itself was not the actual problem, that being that TimTam seems to have used the incorrect URL to link to said post, but this was also noticed as rendering the pingbacks themselves as absolutely ugly comments. --- xmlrpc.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'xmlrpc.php') diff --git a/xmlrpc.php b/xmlrpc.php index 2c634d3..69990da 100755 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -58,9 +58,21 @@ function ping($xmlrpcmsg) $title = $from; } - $text = substr($page_data,(stripos($page_data,$to)-300),700); - $text = strip_tags($text); - $text = str_replace("\n",' ',$text); + preg_match_all('/HREF="([^"]+)">([^>]+)<\/A>/i',$page_data,$matches); + for ($i=0;$i',"\n",$text); + $text = str_ireplace('
',"\n",$text); + $text = str_replace("\t", ' ', $text); + $text = preg_replace('/' . "\n" . '([ ]*)' . "\n" . '/i', '', $text); $commentText = "[url=" . $from . "]" . $title . "[/url]\n\n[....] " . $text . " [....]"; -- cgit 1.4.1