Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
link
Commits
093c7b8e
Commit
093c7b8e
authored
Apr 10, 2021
by
damienmckenna
Committed by
Damien McKenna
Apr 10, 2021
Browse files
Issue #3208147 by DamienMcKenna: Simplify nested ternary logic in _link_sanitize().
parent
0b1a5d7a
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.txt
View file @
093c7b8e
...
...
@@ -10,6 +10,7 @@ Link 7.x-1.x-dev, xxxx-xx-xx
#3120382 by dsnopek, RenatoG, DamienMcKenna: Notice: Undefined index: title in
link_field_load() (line 310 of link.module).
By DamienMcKenna: Unnecessary syntax change broke PHP 5.3 compatibility.
#3208147 by DamienMcKenna: Simplify nested ternary logic in _link_sanitize().
Link 7.x-1.7, 2019-11-14
...
...
link.module
View file @
093c7b8e
...
...
@@ -627,9 +627,15 @@ function _link_sanitize(&$item, $delta, &$field, $instance, &$entity) {
$entity_type
=
$instance
[
'entity_type'
];
$entity_info
=
entity_get_info
(
$entity_type
);
$property_id
=
$entity_info
[
'entity keys'
][
'id'
];
$entity_token_type
=
isset
(
$entity_info
[
'token type'
])
?
$entity_info
[
'token type'
]
:
(
$entity_type
==
'taxonomy_term'
||
$entity_type
==
'taxonomy_vocabulary'
?
str_replace
(
'taxonomy_'
,
''
,
$entity_type
)
:
$entity_type
);
if
(
isset
(
$entity_info
[
'token type'
]))
{
$entity_token_type
=
$entity_info
[
'token type'
];
}
elseif
(
$entity_type
==
'taxonomy_term'
||
$entity_type
==
'taxonomy_vocabulary'
)
{
$entity_token_type
=
str_replace
(
'taxonomy_'
,
''
,
$entity_type
);
}
else
{
$entity_token_type
=
$entity_type
;
}
if
(
isset
(
$instance
[
'settings'
][
'enable_tokens'
])
&&
$instance
[
'settings'
][
'enable_tokens'
])
{
$text_tokens
=
token_scan
(
$item
[
'url'
]);
if
(
!
empty
(
$text_tokens
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment