summary refs log tree commit diff stats
path: root/xmlrpc.php
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2008-12-05 15:46:29 -0500
committerStarla Insigna <hatkirby@fourisland.com>2008-12-05 15:46:29 -0500
commit6c4ea65b25b7436027385824f33a0d0afe84ea7b (patch)
tree12b945150997b1f7a4a64936542b2eaf3cd529e9 /xmlrpc.php
parent76d12bd65379d8345ec3e835b2c2e162c46b2f9d (diff)
downloadfourisland-6c4ea65b25b7436027385824f33a0d0afe84ea7b.tar.gz
fourisland-6c4ea65b25b7436027385824f33a0d0afe84ea7b.tar.bz2
fourisland-6c4ea65b25b7436027385824f33a0d0afe84ea7b.zip
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.
Diffstat (limited to 'xmlrpc.php')
-rwxr-xr-xxmlrpc.php18
1 files changed, 15 insertions, 3 deletions
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)
58 $title = $from; 58 $title = $from;
59 } 59 }
60 60
61 $text = substr($page_data,(stripos($page_data,$to)-300),700); 61 preg_match_all('/HREF="([^"]+)">([^>]+)<\/A>/i',$page_data,$matches);
62 $text = strip_tags($text); 62 for ($i=0;$i<count($matches[1]);$i++)
63 $text = str_replace("\n",' ',$text); 63 {
64 if ($matches[1][$i] == $to)
65 {
66 $find = $matches[2][$i];
67 }
68 }
69
70 $text = strip_tags($page_data);
71 $text = substr($text,(stripos($text,$find)-300),700);
72 $text = str_ireplace('<BR>',"\n",$text);
73 $text = str_ireplace('<BR />',"\n",$text);
74 $text = str_replace("\t", ' ', $text);
75 $text = preg_replace('/' . "\n" . '([ ]*)' . "\n" . '/i', '', $text);
64 76
65 $commentText = "[url=" . $from . "]" . $title . "[/url]\n\n[....] " . $text . " [....]"; 77 $commentText = "[url=" . $from . "]" . $title . "[/url]\n\n[....] " . $text . " [....]";
66 78