Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

"Undefined Offset 2" PHP 7.3.4-2/Debian 10 #304

Open
boooyu44 opened this issue Sep 14, 2019 · 1 comment
Open

"Undefined Offset 2" PHP 7.3.4-2/Debian 10 #304

boooyu44 opened this issue Sep 14, 2019 · 1 comment

Comments

@boooyu44
Copy link

boooyu44 commented Sep 14, 2019

While trying to create invoice the library has problem parsing response. Looks critical as it triggers exception with "undefined offset 2"

More details and stack trace on the image

https://i.imgur.com/zScVIWg.png
https://i.imgur.com/4Cnmaab.png

PHP 7.3.4-2/Debian 10

@boooyu44 boooyu44 changed the title Library no working on PHP 7.3.4-2/Debian 10 Library not working on PHP 7.3.4-2/Debian 10 Sep 14, 2019
@boooyu44 boooyu44 changed the title Library not working on PHP 7.3.4-2/Debian 10 Library not working on PHP 7.3.4-2/Debian 10 - "Undefined Offset 2" Sep 14, 2019
@boooyu44 boooyu44 changed the title Library not working on PHP 7.3.4-2/Debian 10 - "Undefined Offset 2" "Undefined Offset 2" PHP 7.3.4-2/Debian 10 Sep 14, 2019
@thes01
Copy link

thes01 commented Sep 19, 2019

The issue is in the regex pattern which does not accept the string starting with "HTTP 2 " (it expects HTTP number.number ...). Solved by (making a fork and) replacing the regex pattern like this in Bitpay/Client/Response.php

preg_match('/^HTTP\/(\d)\s(\d+)\s(.*)/', $lines[$i], $statusLine);

gsaqui added a commit to fansunite/php-bitpay-client that referenced this issue Sep 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants