Bug 28757 - php-pear-HTTP package : PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported
Summary: php-pear-HTTP package : PHP Fatal error: Array and string offset access synt...
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 8
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: PHP Stack Maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-10 12:33 CEST by franck villaume
Modified: 2021-04-12 14:39 CEST (History)
1 user (show)

See Also:
Source RPM: php-pear-HTTP-1.4.1-12.mga8.src.rpm
CVE:
Status comment:


Attachments

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


Note You need to log in before you can comment on or make changes to this bug.