Fix URL encoding in portal blocks.
authorJan Schneider <jan@horde.org>
Thu, 17 Jun 2010 16:35:55 +0000 (18:35 +0200)
committerJan Schneider <jan@horde.org>
Thu, 17 Jun 2010 21:30:18 +0000 (23:30 +0200)
kronolith/lib/Block/summary.php
kronolith/lib/Event.php
kronolith/lib/Event/Horde.php
kronolith/lib/Event/Ical.php

index ca74e44..b982c08 100644 (file)
@@ -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 .= '<strong>';
                 }
-                $html .= ' ' . $event->getLink(null, true, null, true);
+                $html .= ' ' . $event->getLink(null, true, null, true, true);
                 if ($event_active) {
                     $html .= '</strong>';
                 }
index 7a67c29..cd9b351 100644 (file)
@@ -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 = '<span' . $this->getCSSColors() . '>';
index dc55a5a..3d40a06 100644 (file)
@@ -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);
     }
 
     /**
index 1c40849..d324d58 100644 (file)
@@ -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);
     }
 
 }