Merge pull request #7292 from annando/notice

Fix a notice when the author is missing
This commit is contained in:
Hypolite Petovan 2019-06-21 15:42:27 -04:00 committed by GitHub
commit 9ed262ced6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,6 +41,9 @@ class Fetch extends BaseModule
$item = Item::selectFirst(['author-link'], $condition); $item = Item::selectFirst(['author-link'], $condition);
if (empty($item)) { if (empty($item)) {
$parts = parse_url($item["author-link"]); $parts = parse_url($item["author-link"]);
if (empty($parts["scheme"]) || empty($parts["host"])) {
throw new HTTPException\InternalServerErrorException();
}
$host = $parts["scheme"] . "://" . $parts["host"]; $host = $parts["scheme"] . "://" . $parts["host"];
if (Strings::normaliseLink($host) != Strings::normaliseLink($app->getBaseURL())) { if (Strings::normaliseLink($host) != Strings::normaliseLink($app->getBaseURL())) {