From d245963846993a5ab5ac0572f7e988f0865c678e Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Thu, 30 Oct 2008 05:15:01 -0400
Subject: [PATCH] - fix log_bug() for empty 'file' parameter
---
program/include/bugs.inc | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/program/include/bugs.inc b/program/include/bugs.inc
index 56b88c6..869022b 100644
--- a/program/include/bugs.inc
+++ b/program/include/bugs.inc
@@ -73,12 +73,11 @@
if ($CONFIG['debug_level'] & 1)
{
$post_query = ($_SERVER['REQUEST_METHOD'] == 'POST' ? '?_task='.urlencode($_POST['_task']).'&_action='.urlencode($_POST['_action']) : '');
- $log_entry = sprintf("[%s] %s Error: %s in %s on line %d (%s %s)\n",
+ $log_entry = sprintf("[%s] %s Error: %s%s (%s %s)\n",
date("d-M-Y H:i:s O", mktime()),
$program,
$arg_arr['message'],
- $arg_arr['file'],
- $arg_arr['line'],
+ $arg_arr['file'] ? sprintf(' in %s on line %d', $arg_arr['file'], $arg_arr['line']) : '',
$_SERVER['REQUEST_METHOD'],
$_SERVER['REQUEST_URI'] . $post_query);
--
Gitblit v1.9.1