Skip to content

Commit 2d302d7

Browse files
committed
fetch: Return early on error
If an curl fails, we would get the following warning: Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated
1 parent 89c7dda commit 2d302d7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Mf2/Parser.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ function fetch($url, $convertClassic = true, &$curlInfo=null) {
7373
'Accept: text/html'
7474
));
7575
$html = curl_exec($ch);
76+
77+
if ($html === false) {
78+
return null;
79+
}
80+
7681
$info = $curlInfo = curl_getinfo($ch);
7782
curl_close($ch);
7883

0 commit comments

Comments
 (0)