Skip to content

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

Open

Description

@boooyu44

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

Activity

  1. 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[/+] on Sep 14, 2019
  2. 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"[/+] on Sep 14, 2019
  3. 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[/+] on Sep 14, 2019
  4. thes01 commented on Sep 19, 2019

    @thes01

    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);

  5. added a commit that references this issue on Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions