about summary refs log tree commit diff stats
path: root/central
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2008-08-31 13:44:16 +0000
committerKelly Rauchenberger <fefferburbia@gmail.com>2008-08-31 13:44:16 +0000
commit0c8f56b4f22deac3f30d0d746e2341d53a13c880 (patch)
treeb763816c41ef9e22fdb4ac54137c93ee2a426210 /central
parent1c9a47c9d8f40f1250486a650747f4e0afd70b19 (diff)
downloadinstadisc-0c8f56b4f22deac3f30d0d746e2341d53a13c880.tar.gz
instadisc-0c8f56b4f22deac3f30d0d746e2341d53a13c880.tar.bz2
instadisc-0c8f56b4f22deac3f30d0d746e2341d53a13c880.zip
Central: Patched security hole
Fixes #48
Diffstat (limited to 'central')
-rw-r--r--central/trunk/xmlrpc.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/central/trunk/xmlrpc.php b/central/trunk/xmlrpc.php index 15a7a08..a451d93 100644 --- a/central/trunk/xmlrpc.php +++ b/central/trunk/xmlrpc.php
@@ -250,13 +250,16 @@ function addSubscription($username, $verification, $verificationID, $subscriptio
250 250
251function sendDatabase($cserver, $verification, $verificationID, $db, $databaseVersion) 251function sendDatabase($cserver, $verification, $verificationID, $db, $databaseVersion)
252{ 252{
253 if (strpos(@gethostbyaddr($_SERVER['REMOTE_ADDR']), 'fourisland.com') !== FALSE) 253 if (preg_match('/^(.*\.)?fourisland\.com$/', @gethostbyaddr($_SERVER['REMOTE_ADDR'])))
254 { 254 {
255 $db = unserialize($db); 255 $db = unserialize($db);
256 if (isset($db['central.fourisland.com'])) 256 if (isset($db['central.fourisland.com']))
257 { 257 {
258 if (strpos($db['central.fourisland.com']['xmlrpc'], 'fourisland.com') !== FALSE) 258 if (strpos($db['central.fourisland.com']['xmlrpc'], 'fourisland.com') !== FALSE)
259 { 259 {
260 $deldb = "DELETE FROM centralServers";
261 $deldb2 = mysql_query($deldb);
262
260 foreach($db as $name => $value) 263 foreach($db as $name => $value)
261 { 264 {
262 $insdb = "INSERT INTO centralServers (url, code, xmlrpc) VALUES (\"" . mysql_real_escape_string($name) . "\", \"" . mysql_real_escape_string($value['code']) . "\", \"" . mysql_real_escape_string($value['xmlrpc']) . "\")"; 265 $insdb = "INSERT INTO centralServers (url, code, xmlrpc) VALUES (\"" . mysql_real_escape_string($name) . "\", \"" . mysql_real_escape_string($value['code']) . "\", \"" . mysql_real_escape_string($value['xmlrpc']) . "\")";