celtic-project / LTI-PHP

PHP class library for building LTI integrations
GNU Lesser General Public License v3.0
47 stars 37 forks source link

str_replace(): Argument #3 ($subject) must be of type array|string, bool given #81

Closed ernst77 closed 4 months ago

ernst77 commented 4 months ago

My sentry is giving a lot of these errors... str_replace(): Argument #3 ($subject) must be of type array|string, bool given

I guess its comming from here:

    $chResp = curl_exec($ch);
    $message->requestHeaders = explode("\n", trim(str_replace("\r\n", "\n", curl_getinfo($ch, CURLINFO_HEADER_OUT))));
    $chResp = str_replace("\r\n", "\n", $chResp);

src/Http/CurlClient.php

On line 60

Could we handle false (bool) values? Return error instead?

spvickers commented 4 months ago

Thanks; I have some code to commit for this issue. Will do so shortly.