Skip to content

Commit

Permalink
Fix dirname() null param deprecated notice
Browse files Browse the repository at this point in the history
  • Loading branch information
fivefilters committed Apr 20, 2024
1 parent ca965c2 commit c1f7191
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Readability.php
Original file line number Diff line number Diff line change
Expand Up @@ -841,10 +841,10 @@ public function getPathInfo($url)
$pathBase = parse_url($url, PHP_URL_SCHEME) . '://' . parse_url($url, PHP_URL_HOST) . $this->baseURI;
} else {
// Otherwise just prepend the base to the actual path
$pathBase = parse_url($url, PHP_URL_SCHEME) . '://' . parse_url($url, PHP_URL_HOST) . dirname(parse_url($url, PHP_URL_PATH)) . '/'.rtrim($this->baseURI, '/') . '/';
$pathBase = parse_url($url, PHP_URL_SCHEME) . '://' . parse_url($url, PHP_URL_HOST) . dirname(parse_url($url, PHP_URL_PATH) ?? '') . '/' . rtrim($this->baseURI, '/') . '/';
}
} else {
$pathBase = parse_url($url, PHP_URL_SCHEME) . '://' . parse_url($url, PHP_URL_HOST) . dirname(parse_url($url, PHP_URL_PATH)) . '/';
$pathBase = parse_url($url, PHP_URL_SCHEME) . '://' . parse_url($url, PHP_URL_HOST) . dirname(parse_url($url, PHP_URL_PATH) ?? '') . '/';
}

$scheme = parse_url($pathBase, PHP_URL_SCHEME);
Expand Down

0 comments on commit c1f7191

Please sign in to comment.