- Patch #961908 by dalin, Damien Tournoud: make drupal_attributes() faster.

merge-requests/26/head
Dries Buytaert 2010-11-05 01:29:20 +00:00
parent 687ade1998
commit 6e6761edaa
1 changed files with 1 additions and 3 deletions

View File

@ -2210,9 +2210,7 @@ function drupal_http_header_attributes(array $attributes = array()) {
*/
function drupal_attributes(array $attributes = array()) {
foreach ($attributes as $attribute => &$data) {
if (is_array($data)) {
$data = implode(' ', $data);
}
$data = implode(' ', (array) $data);
$data = $attribute . '="' . check_plain($data) . '"';
}
return $attributes ? ' ' . implode(' ', $attributes) : '';