Fix trailing ampersands when empty array passed as query param
authorChristian Wach <needle@haystack.co.uk>
Tue, 15 Jan 2019 12:28:17 +0000 (12:28 +0000)
committerChristian Wach <needle@haystack.co.uk>
Tue, 15 Jan 2019 12:28:17 +0000 (12:28 +0000)
CRM/Utils/System/WordPress.php

index 7dd040872e2ea92afec149003e37f2efde01f522..f450056bdbd65a3671a8863d50d0b437b717df00 100644 (file)
@@ -257,11 +257,6 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
 
     $queryParts = array();
 
-    // CRM_Core_Payment::getReturnSuccessUrl() passes $query as an array
-    if (isset($query) && is_array($query)) {
-      $query = implode($separator, $query);
-    }
-
     if (
       // not using clean URLs
       !$config->cleanURL
@@ -283,7 +278,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
       if ($wpPageParam) {
         $queryParts[] = $wpPageParam;
       }
-      if (isset($query)) {
+      if (!empty($query)) {
         $queryParts[] = $query;
       }