summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 7671cd0f8..568115a86 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -5619,7 +5619,8 @@ function element_set_attributes(array &$element, array $map) {
if (is_int($property)) {
$property = '#' . $attribute;
}
- if (isset($element[$property])) {
+ // Do not overwrite already existing attributes.
+ if (isset($element[$property]) && !isset($element['#attributes'][$attribute])) {
$element['#attributes'][$attribute] = $element[$property];
}
}