Merge pull request #12264 from annando/error
Fix "Argument #1 ($parts) must be of type array, bool given"
This commit is contained in:
commit
01558d6dda
|
@ -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 New Issue
Block a user