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
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
|
||||
{
|
||||
$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']);
|
||||
|
|
Loading…
Reference in a new issue