A couple of security issues fixed.
[fa-stable.git] / admin / db / users_db.inc
index 267029c96f2c2bd685fbbd60f6b5bd5d316c82de..767dad30339d1363a6d1b2e1d3797683b457c036 100644 (file)
@@ -197,7 +197,7 @@ function show_users_online()
                }
 
                // Add user to database
-               db_query("INSERT INTO ".TB_PREF."useronline (timestamp, ip, file) VALUES ('". $timestamp ."','". $ip ."','". $_SERVER['PHP_SELF'] ."')");
+               db_query("INSERT INTO ".TB_PREF."useronline (timestamp, ip, file) VALUES ('". $timestamp ."',". db_escape($ip) .",". db_escape($_SERVER['PHP_SELF']) .")");
                //Remove users that were not online within $timeoutseconds.
                db_query("DELETE FROM ".TB_PREF."useronline WHERE timestamp<". $timeout);
 
@@ -210,4 +210,4 @@ function show_users_online()
        return "$users ".($users == 1 ? _("user online") : _("users online"));
 
 }
-?>
\ No newline at end of file
+?>