From 9ab35f28730f69d8c8afe4aa650c90c96f342ce4 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Fri, 13 Sep 2013 13:08:22 -0400
Subject: [PATCH] Smarter URL building.

---
 module/VuFind/src/VuFind/Controller/MyResearchController.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/module/VuFind/src/VuFind/Controller/MyResearchController.php b/module/VuFind/src/VuFind/Controller/MyResearchController.php
index f833697d825..de9704354e2 100644
--- a/module/VuFind/src/VuFind/Controller/MyResearchController.php
+++ b/module/VuFind/src/VuFind/Controller/MyResearchController.php
@@ -663,8 +663,9 @@ class MyResearchController extends AbstractBase
                     $params[] = urlencode('ids[]') . '=' . urlencode($id);
                 }
                 $saveUrl = $this->getLightboxAwareUrl('cart-save');
+                $saveUrl .= (strpos($saveUrl, '?') === false) ? '?' : '&';
                 return $this->redirect()
-                    ->toUrl($saveUrl . '?' . implode('&', $params));
+                    ->toUrl($saveUrl . implode('&', $params));
             }
 
             return $this->lightboxAwareRedirect('userList', array('id' => $finalId));
-- 
GitLab