[geeklog-cvs] geeklog: More cases where we should be using DB_delete

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Mar 1 15:31:44 EST 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/15dc24cdaccb
changeset: 6814:15dc24cdaccb
user:      Dirk Haun <dirk at haun-online.de>
date:      Sun Mar 01 16:33:31 2009 +0100
description:
More cases where we should be using DB_delete

diffstat:

1 file changed, 4 insertions(+), 2 deletions(-)
public_html/lib-common.php |    6 ++++--

diffs (23 lines):

diff -r 4196a0ba839b -r 15dc24cdaccb public_html/lib-common.php
--- a/public_html/lib-common.php	Sun Mar 01 16:22:02 2009 +0100
+++ b/public_html/lib-common.php	Sun Mar 01 16:33:31 2009 +0100
@@ -340,7 +340,8 @@
 // Handle Who's Online block
 if (COM_isAnonUser() && isset($_SERVER['REMOTE_ADDR'])) {
     // The following code handles anonymous users so they show up properly
-    DB_query( "DELETE FROM {$_TABLES['sessions']} WHERE remote_ip = '{$_SERVER['REMOTE_ADDR']}' AND uid = 1" );
+    DB_delete($_TABLES['sessions'], array('remote_ip', 'uid'),
+                                    array($_SERVER['REMOTE_ADDR'], 1));
 
     $tries = 0;
     do
@@ -5202,7 +5203,8 @@
     }
     $property = addslashes($property);
 
-    DB_query("DELETE FROM {$_TABLES['speedlimit']} WHERE (type = '$type') AND (ipaddress = '$property')");
+    DB_delete($_TABLES['speedlimit'], array('type', 'ipaddress'),
+                                      array($type, $property));
 }
 
 /**



More information about the geeklog-cvs mailing list