From 161d158f8abcce5cac2b0bc49c1c18caa6734ee8 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Mon, 4 Nov 2013 14:12:34 -0500
Subject: [PATCH] Simplified URL generation.

---
 .../VuFind/src/VuFind/RecordDriver/SolrDefault.php | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php b/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php
index 4cd3787f111..5709497375c 100644
--- a/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php
+++ b/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php
@@ -708,14 +708,14 @@ class SolrDefault extends AbstractBase
                 $params['rft.pub'] = $publishers[0];
             }
             $params['rft.edition'] = $this->getEdition();
-            $params['rft.isbn'] = $this->getCleanISBN();
+            $params['rft.isbn'] = (string)$this->getCleanISBN();
             break;
         case 'Article':
             $params['rft_val_fmt'] = 'info:ofi/fmt:kev:mtx:journal';
             $params['rft.genre'] = 'article';
-            $params['rft.issn'] = $this->getCleanISSN();
+            $params['rft.issn'] = (string)$this->getCleanISSN();
             // an article may have also an ISBN:
-            $params['rft.isbn'] = $this->getCleanISBN();
+            $params['rft.isbn'] = (string)$this->getCleanISBN();
             $params['rft.volume'] = $this->getContainerVolume();
             $params['rft.issue'] = $this->getContainerIssue();
             $params['rft.spage'] = $this->getContainerStartPage();
@@ -743,7 +743,7 @@ class SolrDefault extends AbstractBase
             $params['rft.au'] = $this->getPrimaryAuthor();
             break;
              */
-            $params['rft.issn'] = $this->getCleanISSN();
+            $params['rft.issn'] = (string)$this->getCleanISSN();
 
             // Including a date in a title-level Journal OpenURL may be too
             // limiting -- in some link resolvers, it may cause the exclusion
@@ -774,11 +774,7 @@ class SolrDefault extends AbstractBase
         }
 
         // Assemble the URL:
-        $parts = array();
-        foreach ($params as $key => $value) {
-            $parts[] = $key . '=' . urlencode($value);
-        }
-        return implode('&', $parts);
+        return http_build_query($params);
     }
 
     /**
-- 
GitLab