Fix more debug errors

This commit is contained in:
wrongecho 2025-06-18 14:47:21 +01:00
parent d5f94819d0
commit 43ec144bf0
1 changed files with 2 additions and 2 deletions

View File

@ -1659,7 +1659,7 @@ function display_folder_options($parent_folder_id, $client_id, $folder_location
function sanitize_url($url) {
$allowed = ['http', 'https', 'file', 'ftp', 'ftps', 'sftp', 'dav', 'webdav', 'caldav', 'carddav', 'ssh', 'telnet', 'smb', 'rdp', 'vnc', 'rustdesk', 'anydesk', 'connectwise', 'splashtop', 'sip', 'sips', 'ldap', 'ldaps'];
$parts = parse_url($url);
$parts = parse_url($url ?? '');
if (isset($parts['scheme']) && !in_array(strtolower($parts['scheme']), $allowed)) {
// Remove the scheme and colon
$pos = strpos($url, ':');
@ -1673,5 +1673,5 @@ function sanitize_url($url) {
}
// Safe schemes: return escaped original URL
return htmlspecialchars($url, ENT_QUOTES, 'UTF-8');
return htmlspecialchars($url ?? '', ENT_QUOTES, 'UTF-8');
}