From 3c439d97a293838053975b3db0899b79abe6ca16 Mon Sep 17 00:00:00 2001 From: arno Date: Sun, 8 Aug 2010 11:00:49 +0200 Subject: [PATCH] use url view helper --- application/views/helpers/FooterLink.php | 5 +---- application/views/helpers/LogoutLink.php | 6 ++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/application/views/helpers/FooterLink.php b/application/views/helpers/FooterLink.php index 46788c6..50a2f0b 100644 --- a/application/views/helpers/FooterLink.php +++ b/application/views/helpers/FooterLink.php @@ -11,10 +11,7 @@ class Syj_View_Helper_FooterLink extends Zend_View_Helper_Abstract } else { $href = $page->getHRef(); if ($redirect) { - $currentUri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri(); - if (strpos($currentUri, '?') !== false) { - $currentUri = strstr($currentUri, '?', true); - } + $currentUri = $this->view->url(); $href = $this->view->addParamToUrl($href, 'redirect', $currentUri, true); } $link = $this->view->anchor($href, $text, array('class' => 'footer-anchor')); diff --git a/application/views/helpers/LogoutLink.php b/application/views/helpers/LogoutLink.php index d76682e..ad6c6e4 100644 --- a/application/views/helpers/LogoutLink.php +++ b/application/views/helpers/LogoutLink.php @@ -6,11 +6,9 @@ class Syj_View_Helper_LogoutLink extends Zend_View_Helper_Abstract { public function logoutLink() { $currentUri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri(); - if (strpos($currentUri, '?') !== false) { - $currentUri = strstr($currentUri, '?', true); - } + $encodeduri = implode('/', array_map('urlencode', explode('/', $currentUri))); $translatedString = $this->view->translate('logout'); - $href = $this->view->addParamToUrl('logout', 'redirect', $currentUri, true); + $href = $this->view->addParamToUrl('logout', 'redirect', $encodeduri, true); return $this->view->anchor($href, $translatedString, array('id' => 'logout', 'class' => 'login-anchor')); } } -- 2.39.2