Fix "Argument #1 ($parts) must be of type array, bool given"

This commit is contained in:
Michael 2022-11-25 06:08:56 +00:00
parent 313f3d8515
commit fa5e7585a3
1 changed files with 6 additions and 2 deletions

View File

@ -115,12 +115,12 @@ class GServer
*/
public static function getID(string $url, bool $no_check = false): ?int
{
$url = self::cleanURL($url);
if (empty($url)) {
return null;
}
$url = self::cleanURL($url);
$gserver = DBA::selectFirst('gserver', ['id'], ['nurl' => Strings::normaliseLink($url)]);
if (DBA::isResult($gserver)) {
Logger::debug('Got ID for URL', ['id' => $gserver['id'], 'url' => $url, 'callstack' => System::callstack(20)]);
@ -323,6 +323,10 @@ class GServer
$url = str_replace('/index.php', '', $url);
$urlparts = parse_url($url);
if (empty($urlparts)) {
return '';
}
unset($urlparts['user']);
unset($urlparts['pass']);
unset($urlparts['query']);