From aed1a9e3ef57ea6673593cf6273c096780738b8a Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Sun, 7 Aug 2022 18:23:37 -0400 Subject: [PATCH] url params --- CRM/Utils/System.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php index 43148fb6a2..b980182b80 100644 --- a/CRM/Utils/System.php +++ b/CRM/Utils/System.php @@ -244,23 +244,27 @@ class CRM_Utils_System { * An HTML string containing a link to the given path. */ public static function url( - $path = NULL, - $query = NULL, + $path = '', + $query = '', $absolute = FALSE, $fragment = NULL, $htmlize = TRUE, $frontend = FALSE, $forceBackend = FALSE ) { + // handle legacy null params + $path = $path ?? ''; + $query = $query ?? ''; + $query = self::makeQueryString($query); // Legacy handling for when the system passes around html escaped strings - if (strstr(($query ?? ''), '&')) { + if (strstr($query, '&')) { $query = html_entity_decode($query); } // Extract fragment from path or query if munged together - if ($query && strstr(($query ?? ''), '#')) { + if ($query && strstr($query, '#')) { list($path, $fragment) = explode('#', $query); } if ($path && strstr($path, '#')) { -- 2.25.1