From c1f71912ca26448edfbcb577fe16ff8b27aadfba Mon Sep 17 00:00:00 2001 From: "FiveFilters.org" Date: Sun, 21 Apr 2024 00:38:48 +0200 Subject: [PATCH] Fix dirname() null param deprecated notice --- src/Readability.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Readability.php b/src/Readability.php index f809593..50e3bec 100644 --- a/src/Readability.php +++ b/src/Readability.php @@ -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);