summaryrefslogtreecommitdiffstats
path: root/common/contrib/link/SA-CONTRIB-2019-020.patch
blob: af885249e7e441d872f41b28c8c9ca9ff7535c9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/link.inc b/link.inc
index d5ab1fd..8baa779 100644
--- a/link.inc
+++ b/link.inc
@@ -43,6 +43,10 @@ function _link_validate(&$item, $delta, $field, $node, &$optional_field_found) {
   // neither of these keys are certain to be set
   $test = $item + array('url' => NULL, 'title' => NULL);
 
+  if (isset($test['attributes']) && is_string($test['attributes'])) {
+    form_set_error($field['field_name'] .']['. $delta .'][url', t('String values are not acceptable for attributes.'));
+  }
+
   if ($test['url'] && !(isset($field['widget']['default_value'][$delta]['url']) && $test['url'] == $field['widget']['default_value'][$delta]['url'] && !$field['required'])) {
     // Validate the link.
     if (link_validate_url(trim($test['url'])) == FALSE) {