Url::get_absolute_url(): fix checking if the public root URL is relative

This commit is contained in:
Benjamin Renard 2024-06-04 11:45:40 +02:00
parent 23f28d39c7
commit 13c7fcb0a2
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC

View file

@ -492,7 +492,7 @@ class Url {
public static function get_absolute_url($relative_url=null) { public static function get_absolute_url($relative_url=null) {
if (!is_string($relative_url)) if (!is_string($relative_url))
$relative_url = self :: get_current_url(); $relative_url = self :: get_current_url();
if (self :: $public_root_url[0] == '/') { if (self :: $public_root_url && self :: $public_root_url[0] == '/') {
Log :: debug( Log :: debug(
"URL :: get_absolute_url($relative_url): configured public root URL is relative ". "URL :: get_absolute_url($relative_url): configured public root URL is relative ".
"(%s) => try to detect it from current request infos.", "(%s) => try to detect it from current request infos.",