Skip to content

HttpHelper::transfer() / PHP 8 / stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) #282

@gghdev

Description

@gghdev

Hi,

An extra check is needed to avoid a fatal error in PHP 8 in relation to stripos() -- specifically the call in HttpHelper::transfer() which uses an offset of 12. If for whatever reason the haystack is less than 12 characters long, PHP 8 throws:

Uncaught ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) in /var/www/vendor/triagens/arangodb/lib/ArangoDBClient/HttpHelper.php on line 258

I've only seen this error once, after many requests on the same connection, and I'm not sure if there's another issue at play or whether a simple check of the string length is sufficient to resolve the issue?

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