From b183ebe5aa8da9f77cd412bee077f598182b767d Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 6 Aug 2008 13:39:33 +0000 Subject: Central: Tweaked deserialization --- central/trunk/instadisc.php | 9 +++++++-- central/trunk/xmlrpc.php | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/central/trunk/instadisc.php b/central/trunk/instadisc.php index 421f058..6735f32 100644 --- a/central/trunk/instadisc.php +++ b/central/trunk/instadisc.php @@ -58,7 +58,7 @@ function instaDisc_sendItem($username, $id) $getuser2 = mysql_query($getuser); $getuser3 = mysql_fetch_array($getuser2); - $fp = fsockopen($getuser3['ip'], 4444, $errno, $errstr); + $fp = @fsockopen($getuser3['ip'], 4444, $errno, $errstr); if ($fp) { $verID = rand(1,65536); @@ -71,7 +71,8 @@ function instaDisc_sendItem($username, $id) $out .= 'Author: ' . $getitem3['author'] . "\r\n"; $out .= 'URL: ' . $getitem3['url'] . "\r\n"; - foreach (deserialize($getitem3['semantics']) as $name => $value) + $semantics = deserialize($getitem3['semantics']); + foreach ($semantics as $name => $value) { $out .= $name . ': ' . $value . "\r\n"; } @@ -80,6 +81,10 @@ function instaDisc_sendItem($username, $id) fwrite($fp, $out); fclose($fp); + + return true; + } else { + return false; } } } diff --git a/central/trunk/xmlrpc.php b/central/trunk/xmlrpc.php index 5373f80..18aa6cb 100644 --- a/central/trunk/xmlrpc.php +++ b/central/trunk/xmlrpc.php @@ -63,7 +63,10 @@ function requestRetained($username, $verification, $verificationID) $i=0; while ($getitems3[$i] = mysql_fetch_array($getitems2)) { - instaDisc_sendItem($username, $getitems3[$i]['itemID']); + if (!instaDisc_sendItem($username, $getitems3[$i]['itemID'])) + { + return new xmlrpcresp(new xmlrpcval(1, "int")); + } $i++; } -- cgit 1.4.1