summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-10-16 00:00:17 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-10-16 00:00:17 +0000
commitab190206e75a11316753a73decffd5516e6945b9 (patch)
tree332cc1f7a3c1c5a8bd55dfd68f58cf764b103f19 /includes/common.inc
parent0bdaa32692bca9dd1bf2acd9756a01c5a5228e74 (diff)
downloadbrdo-ab190206e75a11316753a73decffd5516e6945b9.tar.gz
brdo-ab190206e75a11316753a73decffd5516e6945b9.tar.bz2
#642160 by boombatower, Damien Tournoud: Make debug() message more usable.
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/common.inc b/includes/common.inc
index b6c6177c8..bde006f42 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -6841,7 +6841,11 @@ function _drupal_flush_css_js() {
*/
function debug($data, $label = NULL, $print_r = FALSE) {
// Print $data contents to string.
- $string = $print_r ? print_r($data, TRUE) : var_export($data, TRUE);
+ $string = check_plain($print_r ? print_r($data, TRUE) : var_export($data, TRUE));
+
+ // Display values with pre-formatting to increase readability.
+ $string = '<pre>' . $string . '</pre>';
+
trigger_error(trim($label ? "$label: $string" : $string));
}