#1128518 php-slim: Slim\Http\Uri fails to handle non-string URI queries

Package:
php-slim
Source:
php-slim
Submitter:
Thomas Uhle
Date:
2026-02-20 20:03:01 UTC
Severity:
normal
Tags:
#1128518#5
Date:
2026-02-20 19:43:03 UTC
From:
To:
Dear maintainers,

while building php-di-slim-bridge from source, PHPUnit reports the
following when called with the option '--display-deprecation':

10 tests triggered 1 PHP deprecation:

1) /usr/share/php/Slim/Http/Uri.php:719
preg_replace_callback(): Passing null to parameter #3 ($subject) of type array|string is deprecated

The reason is basically that parse_url() returns null instead of an
empty string in Uri::createFromEnvironment() if the requested part of
the URL does not exist.  This issue has already been fixed for Slim 4
in slim/psr7.

I am going to provide a patch once I have received a ticket number.

Best regards,

Thomas Uhle

#1128518#12
Date:
2026-02-20 20:00:51 UTC
From:
To:
Dear maintainers,

please find attached the fixes that I have backported from slim/psr7.

Best regards,

Thomas Uhle