Fixed external URLs in quotes
authorMarcel Werk <burntime@woltlab.com>
Thu, 15 Aug 2013 10:31:57 +0000 (12:31 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 15 Aug 2013 10:31:57 +0000 (12:31 +0200)
com.woltlab.wcf/templates/quoteBBCodeTag.tpl
wcfsetup/install/files/lib/system/bbcode/QuoteBBCode.class.php

index c1c386b0dda9bf94a0e49ba002af9398361c7d70..d1001b360412ffc536d51ae466327373c9f72275 100644 (file)
@@ -3,7 +3,7 @@
                <header>
                        <h3>
                                {if $quoteLink}
-                                       <a href="{@$quoteLink}">{lang}wcf.bbcode.quote.title{/lang}</a>
+                                       <a href="{@$quoteLink}"{if $isExternalQuoteLink} class="externalURL"{if EXTERNAL_LINK_REL_NOFOLLOW} rel="nofollow"{/if}{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}{/if}>{lang}wcf.bbcode.quote.title{/lang}</a>
                                {else}
                                        {lang}wcf.bbcode.quote.title{/lang}
                                {/if}
index 573a39016fc81e76068e5634e9110c415ec58dbf..52312f2c2b32ba5775272e025f871d3e7c31c640 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\system\bbcode;
+use wcf\system\application\ApplicationHandler;
 use wcf\system\WCF;
 
 /**
@@ -21,7 +22,8 @@ class QuoteBBCode extends AbstractBBCode {
                        WCF::getTPL()->assign(array(
                                'content' => $content,
                                'quoteLink' => (!empty($openingTag['attributes'][1]) ? $openingTag['attributes'][1] : ''),
-                               'quoteAuthor' => (!empty($openingTag['attributes'][0]) ? $openingTag['attributes'][0] : '')
+                               'quoteAuthor' => (!empty($openingTag['attributes'][0]) ? $openingTag['attributes'][0] : ''),
+                               'isExternalQuoteLink' => (!empty($openingTag['attributes'][1]) ? !ApplicationHandler::getInstance()->isInternalURL($openingTag['attributes'][1]) : false)
                        ));
                        return WCF::getTPL()->fetch('quoteBBCodeTag');
                }