Bug 28757

Summary: php-pear-HTTP package : PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported
Product: Mageia Reporter: franck villaume <franck.villaume>
Component: RPM PackagesAssignee: PHP Stack Maintainers <php>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Normal CC: mageia
Version: 8   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: php-pear-HTTP-1.4.1-12.mga8.src.rpm CVE:
Status comment:

Description franck villaume 2021-04-10 12:33:36 CEST
Description of problem:
Using HTTP.php, I get the following error:
PHP Fatal error:  Array and string offset access syntax with curly braces is no longer supported

The error is at line 500 and following:

        if (!strlen($url) || $url{0} == '#') {
            $url = $uriAll.$url;
        } elseif ($url{0} == '?') {
            $url = $uriBase.$url;
        }
        if ($url{0} == '/') {
            return $server . $url;
        }

Since PHP7.4, Curly Braces is not suppoorted.

How to fix:
Replace url{0} with url[0] in code.

For information, HTTP2 has superseeded HTTP but has the same issue.
franck villaume 2021-04-10 12:35:23 CEST

Summary: pear-HTTP package : PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported => php-pear-HTTP package : PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported

Comment 1 Lewis Smith 2021-04-12 12:22:04 CEST
Thank you for this report re php-pear-HTTP : /usr/share/pear/HTTP.php

Are these related pkgs (each its own SRPM) - or others - similarly affected?
 php-pear-Net_Monitor:/usr/share/pear/Net/Monitor/Service/HTTP.php
 php-pear-Auth_HTTP:/usr/share/pear/Auth/HTTP.php
 php-pear-SOAP:/usr/share/pear/SOAP/Transport/HTTP.php

I cannot find HTTP2 chez-nous.

Assigning to PHP stack maintainers.

Assignee: bugsquad => php

Comment 2 Marc Krämer 2021-04-12 14:39:55 CEST
yeah, most pear packages are outdated. there is not much active development anymore.

CC: (none) => mageia