Simplify url attribute generation
authorjoshuaruesweg <ruesweg@woltlab.com>
Fri, 5 Mar 2021 13:20:14 +0000 (14:20 +0100)
committerjoshuaruesweg <ruesweg@woltlab.com>
Tue, 16 Mar 2021 15:19:14 +0000 (16:19 +0100)
com.woltlab.wcf/templates/unfurlUrl.tpl

index 6e304430b26890ebeeb9ba879913b065edc6aca8..0331a63126650f12367bb2d0aacb704b627a49d1 100644 (file)
@@ -1,6 +1,6 @@
 {if $object->status == "SUCCESSFUL"}
        <div class="unfurlCard {if $object->imageType == 'COVER' && !$object->getImageUrl()|empty}unfurlLargeContentImage{elseif $object->imageType == 'SQUARED' && !$object->getImageUrl()|empty}unfurlSquaredContentImage{/if}">
-               <a href="{$object->url}"{if EXTERNAL_LINK_REL_NOFOLLOW || EXTERNAL_LINK_TARGET_BLANK} rel="{if EXTERNAL_LINK_REL_NOFOLLOW}nofollow{/if}{if EXTERNAL_LINK_REL_NOFOLLOW && EXTERNAL_LINK_TARGET_BLANK} {/if}{if EXTERNAL_LINK_TARGET_BLANK}noopener noreferrer{/if}"{/if}{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}>
+               <a {anchorAttributes url=$object->url appendClassname=false isUgc=true}>
                        <div{if !$object->getImageUrl()|empty} style="background-image: url('{$object->getImageUrl()}')"{/if}></div>
                        <div class="unfurlInformation">
                                <div class="urlTitle">{$object->title}</div>
@@ -10,5 +10,5 @@
                </a>
        </div>
 {else}
-       <a href="{$object->url}" class="externalURL" {if EXTERNAL_LINK_REL_NOFOLLOW || EXTERNAL_LINK_TARGET_BLANK} rel="{if EXTERNAL_LINK_REL_NOFOLLOW}nofollow{/if}{if EXTERNAL_LINK_REL_NOFOLLOW && EXTERNAL_LINK_TARGET_BLANK} {/if}{if EXTERNAL_LINK_TARGET_BLANK}noopener noreferrer{/if}"{/if}{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}>{$object->url}</a>
+       <a {anchorAttributes url=$object->url isUgc=true}>{$object->url}</a>
 {/if}
\ No newline at end of file