aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/functions.inc.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index ae5f46415..0c4e462e9 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -354,15 +354,18 @@ function pwg_log( $file, $category, $picture = '' )
if ($conf['log'])
{
+ $login = ($user['id'] == $conf['guest_id'])
+ ? 'guest' : addslashes($user['username']);
+
$query = '
INSERT INTO '.HISTORY_TABLE.'
(date,login,IP,file,category,picture)
VALUES
(NOW(),
- \''.(($user['id'] == 2) ? 'guest' : addslashes($user['username'])).'\',
+ \''.$login.'\',
\''.$_SERVER['REMOTE_ADDR'].'\',
\''.addslashes($file).'\',
- \''.addslashes($category).'\',
+ \''.addslashes(strip_tags($category)).'\',
\''.addslashes($picture).'\')
;';
pwg_query($query);