aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-05-27 16:24:21 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-05-27 16:24:21 +0000
commitce4445f74a28eaee02c8d90c1a04a759cf88a9c3 (patch)
treefc3af067265d1df62ec14ae912fa5333a535b789 /phpBB/includes/functions.php
parentb51b978854adf0e5cd902f01cd2da9f34f19429d (diff)
downloadforums-ce4445f74a28eaee02c8d90c1a04a759cf88a9c3.tar
forums-ce4445f74a28eaee02c8d90c1a04a759cf88a9c3.tar.gz
forums-ce4445f74a28eaee02c8d90c1a04a759cf88a9c3.tar.bz2
forums-ce4445f74a28eaee02c8d90c1a04a759cf88a9c3.tar.xz
forums-ce4445f74a28eaee02c8d90c1a04a759cf88a9c3.zip
- remove description from profile fields
- added disclaimer about DEBUG_EXTRA to the ACP (i think this is needed - some idiots might think it is wise to have this enabled on a production board. :) We *may* let it there for the Betas though, but it will be removed during the RC's) - some bugfixes git-svn-id: file:///svn/phpbb/trunk@5973 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php82
1 files changed, 28 insertions, 54 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 07783b5876..db612f7aa5 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -668,18 +668,23 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
return;
}
- $db->sql_return_on_error(true);
+ $use_user_id = (!$user_id) ? $user->data['user_id'] : $user_id;
- $sql_ary = array(
- 'user_id' => (!$user_id) ? $user->data['user_id'] : $user_id,
- 'topic_id' => $topic_id,
- 'topic_posted' => 1
- );
+ if ($config['load_db_track'] && $use_user_id != ANONYMOUS)
+ {
+ $db->sql_return_on_error(true);
- $db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
-
- $db->sql_return_on_error(false);
+ $sql_ary = array(
+ 'user_id' => $use_user_id,
+ 'topic_id' => $topic_id,
+ 'topic_posted' => 1
+ );
+
+ $db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
+ $db->sql_return_on_error(false);
+ }
+
return;
}
}
@@ -2024,47 +2029,25 @@ function get_backtrace()
// Strip the current directory from path
$trace['file'] = str_replace(array($path, '\\'), array('', '/'), $trace['file']);
$trace['file'] = substr($trace['file'], 1);
-
$args = array();
- foreach ($trace['args'] as $argument)
+
+ // If include/require/include_once is not called, do not show arguments - they may contain sensible informations
+ if (!in_array($trace['function'], array('include', 'require', 'include_once')))
{
- switch (gettype($argument))
+ unset($trace['args']);
+ }
+ else
+ {
+ // Path...
+ if (!empty($trace['args'][0]))
{
- case 'integer':
- case 'double':
- $args[] = $argument;
- break;
-
- case 'string':
- $argument = htmlspecialchars(substr($argument, 0, 64)) . ((strlen($argument) > 64) ? '...' : '');
- $args[] = "'{$argument}'";
- break;
-
- case 'array':
- $args[] = 'Array(' . sizeof($argument) . ')';
- break;
-
- case 'object':
- $args[] = 'Object(' . get_class($argument) . ')';
- break;
-
- case 'resource':
- $args[] = 'Resource(' . strstr($argument, '#') . ')';
- break;
-
- case 'boolean':
- $args[] = ($argument) ? 'true' : 'false';
- break;
-
- case 'NULL':
- $args[] = 'NULL';
- break;
-
- default:
- $args[] = 'Unknown';
+ $argument = htmlspecialchars($trace['args'][0]);
+ $argument = str_replace(array($path, '\\'), array('', '/'), $argument);
+ $argument = substr($argument, 1);
+ $args[] = "'{$argument}'";
}
}
-
+
$trace['class'] = (!isset($trace['class'])) ? '' : $trace['class'];
$trace['type'] = (!isset($trace['type'])) ? '' : $trace['type'];
@@ -2072,15 +2055,6 @@ function get_backtrace()
$output .= '<b>FILE:</b> ' . htmlspecialchars($trace['file']) . '<br />';
$output .= '<b>LINE:</b> ' . $trace['line'] . '<br />';
- // Do not display the users password
- if (strpos($trace['function'], 'login') !== false)
- {
- if (isset($args[1]))
- {
- $args[1] = "'***'";
- }
- }
-
$output .= '<b>CALL:</b> ' . htmlspecialchars($trace['class'] . $trace['type'] . $trace['function']) . '(' . ((sizeof($args)) ? implode(', ', $args) : '') . ')<br />';
}
$output .= '</div>';