Properly strip `encode` parameter in LinkBlockTemplatePlugin
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 25 Oct 2019 11:18:32 +0000 (13:18 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 25 Oct 2019 11:18:32 +0000 (13:18 +0200)
wcfsetup/install/files/lib/system/template/plugin/LinkBlockTemplatePlugin.class.php

index 6d2b19b47683914fb349741abc0bce904db37fd9..6dd4938109ab50d9df3f8dfcb6146be8f628afac 100644 (file)
@@ -48,11 +48,12 @@ class LinkBlockTemplatePlugin implements IBlockTemplatePlugin {
                }
                
                if (isset($tagArgs['encode'])) {
-                       if (!$tagArgs['encode']) {
+                       $encode = $tagArgs['encode'];
+                       unset($tagArgs['encode']);
+
+                       if (!$encode) {
                                return LinkHandler::getInstance()->getLink($tagArgs['controller'], $tagArgs, $blockContent);
                        }
-                       
-                       unset($tagArgs['encode']);
                }
                
                return StringUtil::encodeHTML(LinkHandler::getInstance()->getLink($tagArgs['controller'], $tagArgs, $blockContent));