From 4178cf41659e31f0c7893be080bf7214f2fe5600 Mon Sep 17 00:00:00 2001 From: colemanw Date: Thu, 20 Jul 2023 22:47:02 -0400 Subject: [PATCH] System - Prevent php deprecation notice in pushUserContext --- CRM/Utils/String.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/CRM/Utils/String.php b/CRM/Utils/String.php index 7cb44d0fc1..e9ba8ee98f 100644 --- a/CRM/Utils/String.php +++ b/CRM/Utils/String.php @@ -355,14 +355,11 @@ class CRM_Utils_String { * true if the urls match, else false */ public static function match($url1, $url2) { - $url1 = strtolower($url1); - $url2 = strtolower($url2); + $component1 = parse_url(strtolower($url1)); + $component2 = parse_url(strtolower($url2)); - $url1Str = parse_url($url1); - $url2Str = parse_url($url2); - - if ($url1Str['path'] == $url2Str['path'] && - self::extractURLVarValue(CRM_Utils_Array::value('query', $url1Str)) == self::extractURLVarValue(CRM_Utils_Array::value('query', $url2Str)) + if ($component1['path'] == $component2['path'] && + self::extractURLVarValue($component1['query'] ?? '') == self::extractURLVarValue($component2['query'] ?? '') ) { return TRUE; } -- 2.25.1