From 3ab169fc8b803424f90f76eda3979cab7fadba44 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 10 Mar 2004 19:32:37 +0000 Subject: - Fixed bug #6345: drupal_attributes() adds redundant space. --- includes/common.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/common.inc b/includes/common.inc index b341460b5..0264418bd 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1088,12 +1088,13 @@ function url($url = NULL, $query = NULL, $fragment = NULL, $absolute = NULL) { } } -function drupal_attributes($attributes = NULL) { - if (is_array($attributes)) { +function drupal_attributes($attributes = array()) { + if (count($attributes)) { $t = array(); foreach ($attributes as $key => $value) { $t[] = "$key=\"$value\""; } + return " ". implode($t, " "); } } -- cgit v1.2.3