From 3644cfe2d76526cca4e429520440b8db262d275b Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Thu, 17 Jun 2010 18:35:55 +0200 Subject: [PATCH] Fix URL encoding in portal blocks. --- kronolith/lib/Block/summary.php | 3 ++- kronolith/lib/Event.php | 8 ++++---- kronolith/lib/Event/Horde.php | 4 ++-- kronolith/lib/Event/Ical.php | 6 +++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/kronolith/lib/Block/summary.php b/kronolith/lib/Block/summary.php index ca74e44d5..b982c0866 100644 --- a/kronolith/lib/Block/summary.php +++ b/kronolith/lib/Block/summary.php @@ -179,6 +179,7 @@ class Horde_Block_Kronolith_summary extends Horde_Block { $dayname = $day->strftime($GLOBALS['prefs']->getValue('date_format')); } $url = Horde::applicationUrl('day.php', true) + ->setRaw(false) ->add('date', $day->dateString()); if (isset($this->_params['calendar']) && $this->_params['calendar'] != '__all') { @@ -209,7 +210,7 @@ class Horde_Block_Kronolith_summary extends Horde_Block { if ($event_active) { $html .= ''; } - $html .= ' ' . $event->getLink(null, true, null, true); + $html .= ' ' . $event->getLink(null, true, null, true, true); if ($event_active) { $html .= ''; } diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index 7a67c29cf..cd9b3510c 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -2494,13 +2494,13 @@ abstract class Kronolith_Event * * @return Horde_Url */ - public function getViewUrl($params = array(), $full = false) + public function getViewUrl($params = array(), $full = false, $encoded = true) { $params['eventID'] = $this->id; $params['calendar'] = $this->calendar; $params['type'] = $this->calendarType; - return Horde::applicationUrl('event.php', $full)->add($params); + return Horde::applicationUrl('event.php', $full)->setRaw(!$encoded)->add($params); } /** @@ -2549,7 +2549,7 @@ abstract class Kronolith_Event } public function getLink($datetime = null, $icons = true, $from_url = null, - $full = false) + $full = false, $encoded = true) { global $prefs, $registry; @@ -2561,7 +2561,7 @@ abstract class Kronolith_Event } $event_title = $this->getTitle(); - $view_url = $this->getViewUrl(array('datetime' => $datetime->strftime('%Y%m%d%H%M%S'), 'url' => $from_url), $full); + $view_url = $this->getViewUrl(array('datetime' => $datetime->strftime('%Y%m%d%H%M%S'), 'url' => $from_url), $full, $encoded); $read_permission = $this->hasPermission(Horde_Perms::READ); $link = 'getCSSColors() . '>'; diff --git a/kronolith/lib/Event/Horde.php b/kronolith/lib/Event/Horde.php index dc55a5a4c..3d40a06fc 100644 --- a/kronolith/lib/Event/Horde.php +++ b/kronolith/lib/Event/Horde.php @@ -253,13 +253,13 @@ class Kronolith_Event_Horde extends Kronolith_Event * * @return Horde_Url */ - public function getViewUrl($params = array(), $full = false) + public function getViewUrl($params = array(), $full = false, $encoded = true) { if (empty($this->_link)) { return null; } $url = clone $this->_link; - return $url->setRaw($full); + return $url->setRaw(!$encoded); } /** diff --git a/kronolith/lib/Event/Ical.php b/kronolith/lib/Event/Ical.php index 1c4084917..d324d5892 100644 --- a/kronolith/lib/Event/Ical.php +++ b/kronolith/lib/Event/Ical.php @@ -76,12 +76,12 @@ class Kronolith_Event_Ical extends Kronolith_Event * * @return Horde_Url */ - public function getViewUrl($params = array(), $full = false) + public function getViewUrl($params = array(), $full = false, $encoded = true) { if ($this->url) { - return new Horde_Url($this->url, $full); + return new Horde_Url($this->url, !$encoded); } - return parent::getViewUrl($params, $full); + return parent::getViewUrl($params, $full, $encoded); } } -- 2.11.0