Fixed links in RSS feeds
authorMarcel Werk <burntime@woltlab.com>
Thu, 9 May 2013 12:27:17 +0000 (14:27 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 9 May 2013 12:27:17 +0000 (14:27 +0200)
wcfsetup/install/files/lib/system/request/LinkHandler.class.php

index f59732508b434172bd57a1200b8d99698df18e69..dd38afdf94f2209c34e5de6fdc142fc5c280a5f0 100644 (file)
@@ -46,6 +46,7 @@ class LinkHandler extends SingletonFactory {
                $isACP = $originIsACP = RequestHandler::getInstance()->isACPRequest();
                $isRaw = false;
                $appendSession = true;
+               $encodeTitle = false;
                if (isset($parameters['application'])) {
                        $abbreviation = $parameters['application'];
                        unset($parameters['application']);
@@ -74,6 +75,10 @@ class LinkHandler extends SingletonFactory {
                        }
                        unset($parameters['forceFrontend']);
                }
+               if (isset($parameters['encodeTitle'])) {
+                       $encodeTitle = $parameters['encodeTitle'];
+                       unset($parameters['encodeTitle']);
+               }
                
                // remove anchor before parsing
                if (($pos = strpos($url, '#')) !== false) {
@@ -107,6 +112,8 @@ class LinkHandler extends SingletonFactory {
                if (isset($parameters['title'])) {
                        // remove illegal characters
                        $parameters['title'] = trim($this->titleRegex->replace($parameters['title'], '-'), '-');
+                       // encode title
+                       if ($encodeTitle) $parameters['title'] = rawurlencode($parameters['title']);
                }
                
                $parameters['controller'] = $controller;