- Patch #961908 by dalin, Damien Tournoud: make drupal_attributes() faster.
parent
687ade1998
commit
6e6761edaa
|
@ -2210,9 +2210,7 @@ function drupal_http_header_attributes(array $attributes = array()) {
|
||||||
*/
|
*/
|
||||||
function drupal_attributes(array $attributes = array()) {
|
function drupal_attributes(array $attributes = array()) {
|
||||||
foreach ($attributes as $attribute => &$data) {
|
foreach ($attributes as $attribute => &$data) {
|
||||||
if (is_array($data)) {
|
$data = implode(' ', (array) $data);
|
||||||
$data = implode(' ', $data);
|
|
||||||
}
|
|
||||||
$data = $attribute . '="' . check_plain($data) . '"';
|
$data = $attribute . '="' . check_plain($data) . '"';
|
||||||
}
|
}
|
||||||
return $attributes ? ' ' . implode(' ', $attributes) : '';
|
return $attributes ? ' ' . implode(' ', $attributes) : '';
|
||||||
|
|
Loading…
Reference in New Issue