From 6ce43e548831eaefd44ee2dd343867c539c61cbc Mon Sep 17 00:00:00 2001 From: Brad Kollmyer Date: Fri, 31 Jul 2026 11:45:22 -0700 Subject: [PATCH] gitIssue-374 Fix remaining deprecated ${var} string interpolation in sources PHP 8.2 deprecates "${var}" inside double-quoted strings, and the deprecation fires at compile time when the source file is included. Under the FreePBX Whoops error handler that escalates to an ErrorException, so an affected source (notably LDAP) throws before it can run at all. Completes the sweep started in #988/#989 (PR #371). Co-Authored-By: Claude Fable 5 --- sources/source-CapsuleCRM.module | 2 +- sources/source-LDAP.module | 4 ++-- sources/source-Send_to_MythTV.module | 2 +- sources/source-Send_to_YAC.module | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sources/source-CapsuleCRM.module b/sources/source-CapsuleCRM.module index ff857f4f..0c5a86a6 100644 --- a/sources/source-CapsuleCRM.module +++ b/sources/source-CapsuleCRM.module @@ -114,7 +114,7 @@ class CapsuleCRM extends superfecta_base // return the person name and there organisation if it is set. if ($item->type == 'person') { $organisation = $item->organisation == null ? '' : "- {$item->organisation->name}"; - return trim("{$item->firstName} {$item->lastName} ${organisation}"); + return trim("{$item->firstName} {$item->lastName} {$organisation}"); } // party is an organisation so just return the name diff --git a/sources/source-LDAP.module b/sources/source-LDAP.module index f35f03c0..82ae0580 100644 --- a/sources/source-LDAP.module +++ b/sources/source-LDAP.module @@ -174,7 +174,7 @@ class LDAP extends superfecta_base { switch ($run_param['LDAP_Server']) { case LDAP_OPENDIRECTORY: case LDAP_OPENLDAP: - $dn = "ou=${ou},${dc}"; + $dn = "ou={$ou},{$dc}"; break; case LDAP_CUSTOM: @@ -182,7 +182,7 @@ class LDAP extends superfecta_base { break; } } else { - $dn = "${dc}"; + $dn = "{$dc}"; } $this->DebugEcho("Searching {$dn} ... "); diff --git a/sources/source-Send_to_MythTV.module b/sources/source-Send_to_MythTV.module index e316f7c4..9e2fd891 100644 --- a/sources/source-Send_to_MythTV.module +++ b/sources/source-Send_to_MythTV.module @@ -70,7 +70,7 @@ class Send_to_Mythtv extends superfecta_base { socket_close($sock); - $this->DebugPrint("Send to mythtv: ${mythtv_text}"); + $this->DebugPrint("Send to mythtv: {$mythtv_text}"); } return($thenumber); diff --git a/sources/source-Send_to_YAC.module b/sources/source-Send_to_YAC.module index 618f940e..f9aea232 100644 --- a/sources/source-Send_to_YAC.module +++ b/sources/source-Send_to_YAC.module @@ -34,7 +34,7 @@ class Send_to_YAC extends superfecta_base { $yac_text = $yac_cnam . '~' . $thenumber; shell_exec('/bin/echo -e -n "@CALL' . $yac_text . '"|nc -w 1 ' . $run_param['Server_address'] . ' ' . $run_param['Server_TCP_Port'] . ''); - $this->DebugPrint("Send to YAC: ${yac_text}"); + $this->DebugPrint("Send to YAC: {$yac_text}"); } return($thenumber);