Fix "Argument #1 ($parts) must be of type array, bool given"
This commit is contained in:
parent
313f3d8515
commit
fa5e7585a3
1 changed files with 6 additions and 2 deletions
|
@ -115,12 +115,12 @@ class GServer
|
||||||
*/
|
*/
|
||||||
public static function getID(string $url, bool $no_check = false): ?int
|
public static function getID(string $url, bool $no_check = false): ?int
|
||||||
{
|
{
|
||||||
|
$url = self::cleanURL($url);
|
||||||
|
|
||||||
if (empty($url)) {
|
if (empty($url)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = self::cleanURL($url);
|
|
||||||
|
|
||||||
$gserver = DBA::selectFirst('gserver', ['id'], ['nurl' => Strings::normaliseLink($url)]);
|
$gserver = DBA::selectFirst('gserver', ['id'], ['nurl' => Strings::normaliseLink($url)]);
|
||||||
if (DBA::isResult($gserver)) {
|
if (DBA::isResult($gserver)) {
|
||||||
Logger::debug('Got ID for URL', ['id' => $gserver['id'], 'url' => $url, 'callstack' => System::callstack(20)]);
|
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);
|
$url = str_replace('/index.php', '', $url);
|
||||||
|
|
||||||
$urlparts = parse_url($url);
|
$urlparts = parse_url($url);
|
||||||
|
if (empty($urlparts)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
unset($urlparts['user']);
|
unset($urlparts['user']);
|
||||||
unset($urlparts['pass']);
|
unset($urlparts['pass']);
|
||||||
unset($urlparts['query']);
|
unset($urlparts['query']);
|
||||||
|
|
Loading…
Reference in a new issue