diff --git a/link.module b/link.module index 3d76136..25bef6d 100644 --- a/link.module +++ b/link.module @@ -479,15 +479,13 @@ function _link_sanitize(&$item, $delta, &$field, $instance, &$entity) { // reference we need to ensure that there's always the original data to // process otherwise processed data are processed again which might leads to // unexpected results. - if (!isset($item['_link_sanitize_raw'])) { - // Store copy of original data to use in case of a second call. - $item['_link_sanitize_raw'] = $item; - } - else { - // Restore original data to process. - $item = $item['_link_sanitize_raw']; + if (isset($item['_link_sanitized'])) { + return; } + // Store a flag to check in case of a second call. + $item['_link_sanitized'] = TRUE; + // Don't try to process empty links. if (empty($item['url']) && empty($item['title'])) { return;