Skip to content

gitIssue-374 Fix remaining deprecated ${var} string interpolation in sources - #375

Open
BradKollmyer wants to merge 1 commit into
FreePBX:release/17.0from
BradKollmyer:bugfix/374
Open

gitIssue-374 Fix remaining deprecated ${var} string interpolation in sources#375
BradKollmyer wants to merge 1 commit into
FreePBX:release/17.0from
BradKollmyer:bugfix/374

Conversation

@BradKollmyer

Copy link
Copy Markdown
Contributor

Fixes FreePBX/issue-tracker#1313.

PHP 8.2 deprecates "${var}" inside double-quoted strings. The deprecation is raised at compile time when the file is included, and the FreePBX bootstrap's Whoops error handler escalates it to an ErrorException — so a source file containing the syntax throws on include, before its class can be instantiated. In practice this makes the LDAP source unusable on FreePBX 17 no matter how it is configured.

The sweep from #988/#989 (PR #371, shipped in 17.0.6) removed most occurrences; this completes it. Mechanical ${var}{$var} on the five remaining lines:

File Lines
sources/source-LDAP.module 177, 185
sources/source-CapsuleCRM.module 117
sources/source-Send_to_MythTV.module 73
sources/source-Send_to_YAC.module 37

No behavior change — {$var} produces identical output on all supported PHP versions.

Tested: all four files pass php -l on PHP 8.2.28 (Debian 12). The LDAP source fix is additionally verified end-to-end on a production FreePBX 17.0 / superfecta 17.0.7 install: with the patched file, a scheme debug run returns the correct CNAM from an LDAP phonebook in ~13 ms; unpatched, the include throws Whoops\Exception\ErrorException: Using ${var} in strings is deprecated.

🤖 Generated with Claude Code

…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 FreePBX#371).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sangoma-oss-cla

sangoma-oss-cla Bot commented Jul 31, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@BradKollmyer

Copy link
Copy Markdown
Contributor Author

Gentle nudge on this one — it's been open a couple of weeks with no review.

Still reproducible on release/17.0 as it stands today: sources/source-LDAP.module
lines 177 and 185 continue to use ${var} interpolation.

177:  $dn = "ou=${ou},${dc}";
185:  $dn = "${dc}";

On PHP 8.2 — which is what FreePBX 17 ships on for Debian 12 — that deprecation
becomes a fatal exception on include under the Whoops handler, so the LDAP source
cannot run at all. It isn't a cosmetic warning; the source is simply unusable
until the file is patched by hand, and hand-patching trips the module signature
check and gets reverted by the next module update.

The change is 5 lines across 4 files (LDAP, CapsuleCRM, Send_to_MythTV,
Send_to_YAC) and is the same mechanical fix as the earlier #988/#989 sweep,
which just missed these. CLA is signed and the branch is mergeable.

Happy to split the LDAP fix out into its own PR if bundling the other three
sources is what's holding it up — just say the word.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LDAP source fatally broken on PHP 8.2: deprecated ${var} interpolation missed by #988/#989 sweep

1 participant