diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-07-28 19:22:18 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-07-28 19:22:18 +0000 |
commit | de29094731cc158ce745c96987e6d5fe41b8a655 (patch) | |
tree | 9f1c9ce8895e361ba130dbbc73cdace52291ef7f /includes | |
parent | a938e18a1bd36d887010863817470b690fdbf6f3 (diff) | |
download | brdo-de29094731cc158ce745c96987e6d5fe41b8a655.tar.gz brdo-de29094731cc158ce745c96987e6d5fe41b8a655.tar.bz2 |
- Patch #493746 by Dave Reid: code clean-up of drupal_attributes().
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/common.inc b/includes/common.inc index 15b768e3b..cb69c9548 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -2140,14 +2140,14 @@ function url($path = NULL, array $options = array()) { * @return * An HTML string ready for insertion in a tag. */ -function drupal_attributes($attributes = array()) { - foreach ($attributes as $attribute => $data) { +function drupal_attributes(array $attributes = array()) { + foreach ($attributes as $attribute => &$data) { if (is_array($data)) { $data = implode(' ', $data); } - $items[] = $attribute . '="' . check_plain($data) . '"'; + $data = $attribute . '="' . check_plain($data) . '"'; } - return isset($items) ? ' ' . implode(' ', $items) : ''; + return $attributes ? ' ' . implode(' ', $attributes) : ''; } /** |