Commit 5f0d51ef authored by dsnopek's avatar dsnopek

Issue #3034508: [link] Update for SA-CONTRIB-2019-020

parent 2c7929f5
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) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment