From 77d113d5b3cd8623ab47d614ce059e72f980ec3a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 11 Mar 2014 15:33:27 +0100 Subject: [PATCH] Normalize protocol of internal URLs in QuoteBBCode see dccac62117f3e4b34ad9ee324b327942c93f2c8b --- .../files/lib/system/bbcode/QuoteBBCode.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/bbcode/QuoteBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/QuoteBBCode.class.php index 7c02a9e080..5527a385c8 100644 --- a/wcfsetup/install/files/lib/system/bbcode/QuoteBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/QuoteBBCode.class.php @@ -1,6 +1,7 @@ getOutputType() == 'text/html') { + $quoteLink = (!empty($openingTag['attributes'][1]) ? $openingTag['attributes'][1] : ''); + $externalQuoteLink = (!empty($openingTag['attributes'][1]) ? !ApplicationHandler::getInstance()->isInternalURL($openingTag['attributes'][1]) : false); + if (!$externalQuoteLink) { + $quoteLink = preg_replace('~^https?://~', RouteHandler::getProtocol(), $quoteLink); + } + WCF::getTPL()->assign(array( 'content' => $content, - 'quoteLink' => (!empty($openingTag['attributes'][1]) ? $openingTag['attributes'][1] : ''), + 'quoteLink' => $quoteLink, 'quoteAuthor' => (!empty($openingTag['attributes'][0]) ? $openingTag['attributes'][0] : ''), - 'isExternalQuoteLink' => (!empty($openingTag['attributes'][1]) ? !ApplicationHandler::getInstance()->isInternalURL($openingTag['attributes'][1]) : false) + 'isExternalQuoteLink' => $externalQuoteLink )); return WCF::getTPL()->fetch('quoteBBCodeTag'); } -- 2.20.1